From 74ca5ebec9bf10289393553c2a591977c9268b07 Mon Sep 17 00:00:00 2001 From: Zhang Hao Date: Mon, 18 Oct 2021 17:28:39 +0800 Subject: Replace 0 with nullptr We know that c++11 uses nullptr to replace 0, so we replace 0 with nullptr in the project. Change-Id: I52e3b70f58c477414ad8187e3d3cdae25408ecc7 Reviewed-by: Jarek Kobus --- examples/help/contextsensitivehelp/helpbrowser.cpp | 2 +- src/assistant/assistant/globalactions.cpp | 2 +- ...ols_designer_src_lib_sdk_abstractformeditor.cpp | 4 ++-- ...signer_src_lib_sdk_abstractformwindowcursor.cpp | 2 +- ...igner_src_lib_sdk_abstractformwindowmanager.cpp | 4 ++-- ...esigner_src_lib_sdk_abstractobjectinspector.cpp | 4 ++-- ...designer_src_lib_sdk_abstractpropertyeditor.cpp | 4 ++-- .../doc/snippets/plugins/doc_src_qtdesigner.cpp | 4 ++-- src/linguist/linguist/mainwindow.cpp | 4 ++-- src/linguist/linguist/messageeditor.cpp | 2 +- src/linguist/shared/qm.cpp | 4 ++-- src/qdbus/qdbusviewer/qdbusmodel.cpp | 2 +- src/shared/qtgradienteditor/qtgradienteditor.cpp | 2 +- .../qtgradienteditor/qtgradientstopscontroller.cpp | 2 +- .../qtgradienteditor/qtgradientstopswidget.cpp | 2 +- src/shared/qtgradienteditor/qtgradientview.cpp | 2 +- src/shared/qtgradienteditor/qtgradientwidget.cpp | 2 +- .../qtpropertybrowser/qtbuttonpropertybrowser.cpp | 22 ++++++++++---------- src/shared/qtpropertybrowser/qteditorfactory.cpp | 6 +++--- .../qtgroupboxpropertybrowser.cpp | 24 +++++++++++----------- src/shared/qtpropertybrowser/qtpropertybrowser.cpp | 10 ++++----- .../qtpropertybrowser/qttreepropertybrowser.cpp | 2 +- src/shared/qtpropertybrowser/qtvariantproperty.cpp | 6 +++--- src/shared/qttoolbardialog/qttoolbardialog.cpp | 10 ++++----- 24 files changed, 64 insertions(+), 64 deletions(-) diff --git a/examples/help/contextsensitivehelp/helpbrowser.cpp b/examples/help/contextsensitivehelp/helpbrowser.cpp index 4ff4b5c98..c5b29dad5 100644 --- a/examples/help/contextsensitivehelp/helpbrowser.cpp +++ b/examples/help/contextsensitivehelp/helpbrowser.cpp @@ -64,7 +64,7 @@ HelpBrowser::HelpBrowser(QWidget *parent) m_helpEngine = new QHelpEngineCore(collectionFile, this); if (!m_helpEngine->setupData()) { delete m_helpEngine; - m_helpEngine = 0; + m_helpEngine = nullptr; } } diff --git a/src/assistant/assistant/globalactions.cpp b/src/assistant/assistant/globalactions.cpp index 4e7b73784..f2957a0ad 100644 --- a/src/assistant/assistant/globalactions.cpp +++ b/src/assistant/assistant/globalactions.cpp @@ -239,4 +239,4 @@ void GlobalActions::setupNavigationMenus(QAction *back, QAction *next, #endif } -GlobalActions *GlobalActions::m_instance = 0; +GlobalActions *GlobalActions::m_instance = nullptr; diff --git a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformeditor.cpp b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformeditor.cpp index fd8968a55..14d78b502 100644 --- a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformeditor.cpp +++ b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformeditor.cpp @@ -49,10 +49,10 @@ ****************************************************************************/ //! [0] - QDesignerObjectInspectorInterface *objectInspector = 0; + QDesignerObjectInspectorInterface *objectInspector = nullptr; objectInspector = formEditor->objectInspector(); - QDesignerFormWindowManagerInterface *manager = 0; + QDesignerFormWindowManagerInterface *manager = nullptr; manager = formEditor->formWindowManager(); objectInspector->setFormWindow(manager->formWindow(0)); diff --git a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp index af4c5f39e..369d87fd6 100644 --- a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp +++ b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp @@ -49,7 +49,7 @@ ****************************************************************************/ //! [0] - QDesignerFormWindowInterface *formWindow = 0; + QDesignerFormWindowInterface *formWindow = nullptr; formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget); formWindow->cursor()->setProperty(myWidget, myProperty, newValue); diff --git a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp index 94694f669..7346d6e25 100644 --- a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp +++ b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp @@ -49,8 +49,8 @@ ****************************************************************************/ //! [0] - QDesignerFormWindowManagerInterface *manager = 0; - QDesignerFormWindowInterface *formWindow = 0; + QDesignerFormWindowManagerInterface *manager = nullptr; + QDesignerFormWindowInterface *formWindow = nullptr; manager = formEditor->formWindowManager(); formWindow = manager->formWindow(0); diff --git a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractobjectinspector.cpp b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractobjectinspector.cpp index fd8968a55..14d78b502 100644 --- a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractobjectinspector.cpp +++ b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractobjectinspector.cpp @@ -49,10 +49,10 @@ ****************************************************************************/ //! [0] - QDesignerObjectInspectorInterface *objectInspector = 0; + QDesignerObjectInspectorInterface *objectInspector = nullptr; objectInspector = formEditor->objectInspector(); - QDesignerFormWindowManagerInterface *manager = 0; + QDesignerFormWindowManagerInterface *manager = nullptr; manager = formEditor->formWindowManager(); objectInspector->setFormWindow(manager->formWindow(0)); diff --git a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp index 571796031..2ffd8146c 100644 --- a/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp +++ b/src/designer/src/designer/doc/snippets/lib/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp @@ -49,7 +49,7 @@ ****************************************************************************/ //! [0] - QDesignerPropertyEditorInterface *propertyEditor = 0; + QDesignerPropertyEditorInterface *propertyEditor = nullptr; propertyEditor = formEditor->propertyEditor(); connect(propertyEditor, SIGNAL(propertyChanged(QString,QVariant)), @@ -59,7 +59,7 @@ //! [1] void checkProperty(QString property, QVariant value) { - QDesignerPropertyEditorInterface *propertyEditor = 0; + QDesignerPropertyEditorInterface *propertyEditor = nullptr; propertyEditor = formEditor->propertyEditor(); QObject *object = propertyeditor->object(); diff --git a/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp index 1f76bc71d..79952c13c 100644 --- a/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp +++ b/src/designer/src/designer/doc/snippets/plugins/doc_src_qtdesigner.cpp @@ -54,7 +54,7 @@ //! [2] -QDesignerMemberSheetExtension *memberSheet = 0; +QDesignerMemberSheetExtension *memberSheet = nullptr; QExtensionManager manager = formEditor->extensionManager(); memberSheet = qt_extension(manager, widget); @@ -276,7 +276,7 @@ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface") //! [15] -QDesignerPropertySheetExtension *propertySheet = 0; +QDesignerPropertySheetExtension *propertySheet = nullptr; QExtensionManager manager = formEditor->extensionManager(); propertySheet = qt_extension(manager, widget); diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp index 2dd2b7615..e0b214a3e 100644 --- a/src/linguist/linguist/mainwindow.cpp +++ b/src/linguist/linguist/mainwindow.cpp @@ -1501,7 +1501,7 @@ void MainWindow::selectedMessageChanged(const QModelIndex &sortedIndex, const QM } int model = -1; - MessageItem *m = 0; + MessageItem *m = nullptr; QModelIndex index = m_sortedMessagesModel->mapToSource(sortedIndex); if (index.isValid()) { model = (index.column() && (index.column() - 1 < m_dataModel->modelCount())) ? @@ -2029,7 +2029,7 @@ void MainWindow::doUpdateLatestModel(int model) m_currentIndex = MultiDataIndex(model, m_currentIndex.context(), m_currentIndex.message()); bool enable = false; bool enableRw = false; - MessageItem *item = 0; + MessageItem *item = nullptr; if (model >= 0) { enable = true; if (m_dataModel->isModelWritable(model)) diff --git a/src/linguist/linguist/messageeditor.cpp b/src/linguist/linguist/messageeditor.cpp index 1a126da7a..03659ad9b 100644 --- a/src/linguist/linguist/messageeditor.cpp +++ b/src/linguist/linguist/messageeditor.cpp @@ -386,7 +386,7 @@ void MessageEditor::resetSelection() disconnect(fte, &FormatTextEdit::editorDestroyed, this, &MessageEditor::editorDestroyed); } - m_selectionHolder = 0; + m_selectionHolder = nullptr; #ifndef QT_NO_CLIPBOARD updateCanCutCopy(); #endif diff --git a/src/linguist/shared/qm.cpp b/src/linguist/shared/qm.cpp index c94ca7b82..f51735148 100644 --- a/src/linguist/shared/qm.cpp +++ b/src/linguist/shared/qm.cpp @@ -469,8 +469,8 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) enum { Contexts = 0x2f, Hashes = 0x42, Messages = 0x69, NumerusRules = 0x88, Dependencies = 0x96, Language = 0xa7 }; // for squeezed but non-file data, this is what needs to be deleted - const uchar *messageArray = 0; - const uchar *offsetArray = 0; + const uchar *messageArray = nullptr; + const uchar *offsetArray = nullptr; uint offsetLength = 0; bool ok = true; diff --git a/src/qdbus/qdbusviewer/qdbusmodel.cpp b/src/qdbus/qdbusviewer/qdbusmodel.cpp index 8f47b5bc5..8fdc679b1 100644 --- a/src/qdbus/qdbusviewer/qdbusmodel.cpp +++ b/src/qdbus/qdbusviewer/qdbusmodel.cpp @@ -107,7 +107,7 @@ void QDBusModel::addMethods(QDBusItem *parent, const QDomElement &iface) QDomElement child = iface.firstChildElement(); while (!child.isNull()) { - QDBusItem *item = 0; + QDBusItem *item = nullptr; if (child.tagName() == QLatin1String("method")) { item = new QDBusItem(QDBusModel::MethodItem, child.attribute(QLatin1String("name")), parent); diff --git a/src/shared/qtgradienteditor/qtgradienteditor.cpp b/src/shared/qtgradienteditor/qtgradienteditor.cpp index 57d35b83a..0eb096505 100644 --- a/src/shared/qtgradienteditor/qtgradienteditor.cpp +++ b/src/shared/qtgradienteditor/qtgradienteditor.cpp @@ -137,7 +137,7 @@ public: QGradient QtGradientEditorPrivate::gradient() const { - QGradient *gradient = 0; + QGradient *gradient = nullptr; switch (m_ui.gradientWidget->gradientType()) { case QGradient::LinearGradient: gradient = new QLinearGradient(m_ui.gradientWidget->startLinear(), diff --git a/src/shared/qtgradienteditor/qtgradientstopscontroller.cpp b/src/shared/qtgradienteditor/qtgradientstopscontroller.cpp index 9fb44469a..20cea9499 100644 --- a/src/shared/qtgradienteditor/qtgradientstopscontroller.cpp +++ b/src/shared/qtgradienteditor/qtgradientstopscontroller.cpp @@ -663,7 +663,7 @@ QtGradientStopsController::~QtGradientStopsController() void QtGradientStopsController::setGradientStops(const QGradientStops &stops) { d_ptr->m_model->clear(); - QtGradientStop *first = 0; + QtGradientStop *first = nullptr; for (const QPair &pair : stops) { QtGradientStop *stop = d_ptr->m_model->addStop(pair.first, pair.second); if (!first) diff --git a/src/shared/qtgradienteditor/qtgradientstopswidget.cpp b/src/shared/qtgradienteditor/qtgradientstopswidget.cpp index 02c6434fe..80bc3ed68 100644 --- a/src/shared/qtgradienteditor/qtgradientstopswidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientstopswidget.cpp @@ -710,7 +710,7 @@ void QtGradientStopsWidget::keyPressEvent(QKeyEvent *e) PositionStopMap stops = d_ptr->m_model->stops(); if (stops.isEmpty()) return; - QtGradientStop *newCurrent = 0; + QtGradientStop *newCurrent = nullptr; QtGradientStop *current = d_ptr->m_model->currentStop(); if (!current || e->key() == Qt::Key_Home || e->key() == Qt::Key_End) { if (e->key() == Qt::Key_Left || e->key() == Qt::Key_Home) diff --git a/src/shared/qtgradienteditor/qtgradientview.cpp b/src/shared/qtgradienteditor/qtgradientview.cpp index 40e698818..34c71e6fb 100644 --- a/src/shared/qtgradienteditor/qtgradientview.cpp +++ b/src/shared/qtgradienteditor/qtgradientview.cpp @@ -176,7 +176,7 @@ void QtGradientView::slotGradientActivated(QListWidgetItem *item) QtGradientView::QtGradientView(QWidget *parent) : QWidget(parent) { - m_manager = 0; + m_manager = nullptr; m_ui.setupUi(this); diff --git a/src/shared/qtgradienteditor/qtgradientwidget.cpp b/src/shared/qtgradienteditor/qtgradientwidget.cpp index 40c25f785..7853e3723 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientwidget.cpp @@ -496,7 +496,7 @@ void QtGradientWidget::paintEvent(QPaintEvent *e) p.setBrushOrigin(0, 0); } - QGradient *gradient = 0; + QGradient *gradient = nullptr; switch (d_ptr->m_gradientType) { case QGradient::LinearGradient: gradient = new QLinearGradient(d_ptr->m_startLinear, d_ptr->m_endLinear); diff --git a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp index 144d7bee0..edef8564e 100644 --- a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp @@ -162,8 +162,8 @@ void QtButtonPropertyBrowserPrivate::slotUpdate() { for (WidgetItem *item : qAsConst(m_recreateQueue)) { WidgetItem *parent = item->parent; - QWidget *w = 0; - QGridLayout *l = 0; + QWidget *w = nullptr; + QGridLayout *l = nullptr; const int oldRow = gridRow(item); if (parent) { w = parent->container; @@ -196,7 +196,7 @@ void QtButtonPropertyBrowserPrivate::setExpanded(WidgetItem *item, bool expanded item->expanded = expanded; const int row = gridRow(item); WidgetItem *parent = item->parent; - QGridLayout *l = 0; + QGridLayout *l = nullptr; if (parent) l = parent->layout; else @@ -243,8 +243,8 @@ void QtButtonPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBr WidgetItem *newItem = new WidgetItem(); newItem->parent = parentItem; - QGridLayout *layout = 0; - QWidget *parentWidget = 0; + QGridLayout *layout = nullptr; + QWidget *parentWidget = nullptr; int row = -1; if (!afterItem) { row = 0; @@ -267,7 +267,7 @@ void QtButtonPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBr if (!parentItem->container) { m_recreateQueue.removeAll(parentItem); WidgetItem *grandParent = parentItem->parent; - QGridLayout *l = 0; + QGridLayout *l = nullptr; const int oldRow = gridRow(parentItem); if (grandParent) { l = grandParent->layout; @@ -286,7 +286,7 @@ void QtButtonPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBr if (parentItem->label) { l->removeWidget(parentItem->label); delete parentItem->label; - parentItem->label = 0; + parentItem->label = nullptr; } int span = 1; if (!parentItem->widget && !parentItem->widgetLabel) @@ -366,7 +366,7 @@ void QtButtonPropertyBrowserPrivate::propertyRemoved(QtBrowserItem *index) removeRow(parentItem->layout, row); } else { const WidgetItem *grandParent = parentItem->parent; - QGridLayout *l = 0; + QGridLayout *l = nullptr; if (grandParent) { l = grandParent->layout; } else { @@ -380,9 +380,9 @@ void QtButtonPropertyBrowserPrivate::propertyRemoved(QtBrowserItem *index) l->removeWidget(parentItem->container); delete parentItem->button; delete parentItem->container; - parentItem->button = 0; - parentItem->container = 0; - parentItem->layout = 0; + parentItem->button = nullptr; + parentItem->container = nullptr; + parentItem->layout = nullptr; if (!m_recreateQueue.contains(parentItem)) m_recreateQueue.append(parentItem); if (parentSpan > 1) diff --git a/src/shared/qtpropertybrowser/qteditorfactory.cpp b/src/shared/qtpropertybrowser/qteditorfactory.cpp index dfb3e92a5..31211333e 100644 --- a/src/shared/qtpropertybrowser/qteditorfactory.cpp +++ b/src/shared/qtpropertybrowser/qteditorfactory.cpp @@ -922,7 +922,7 @@ void QtLineEditFactoryPrivate::slotRegExpChanged(QtProperty *property, for (QLineEdit *editor : it.value()) { editor->blockSignals(true); const QValidator *oldValidator = editor->validator(); - QValidator *newValidator = 0; + QValidator *newValidator = nullptr; if (regExp.isValid()) { newValidator = new QRegularExpressionValidator(regExp, editor); } @@ -1553,7 +1553,7 @@ bool QtCharEdit::eventFilter(QObject *o, QEvent *e) actionString = actionString.remove(pos, actionString.length() - pos); action->setText(actionString); } - QAction *actionBefore = 0; + QAction *actionBefore = nullptr; if (actions.count() > 0) actionBefore = actions[0]; QAction *clearAction = new QAction(tr("Clear Char"), menu); @@ -2081,7 +2081,7 @@ void QtCursorEditorFactory::connectPropertyManager(QtCursorPropertyManager *mana QWidget *QtCursorEditorFactory::createEditor(QtCursorPropertyManager *manager, QtProperty *property, QWidget *parent) { - QtProperty *enumProp = 0; + QtProperty *enumProp = nullptr; if (d_ptr->m_propertyToEnum.contains(property)) { enumProp = d_ptr->m_propertyToEnum[property]; } else { diff --git a/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp index b7534e25b..43ca132d8 100644 --- a/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp @@ -115,8 +115,8 @@ void QtGroupBoxPropertyBrowserPrivate::slotUpdate() { for (WidgetItem *item : qAsConst(m_recreateQueue)) { WidgetItem *par = item->parent; - QWidget *w = 0; - QGridLayout *l = 0; + QWidget *w = nullptr; + QGridLayout *l = nullptr; int oldRow = -1; if (!par) { w = q_ptr; @@ -166,8 +166,8 @@ void QtGroupBoxPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, Qt WidgetItem *newItem = new WidgetItem(); newItem->parent = parentItem; - QGridLayout *layout = 0; - QWidget *parentWidget = 0; + QGridLayout *layout = nullptr; + QWidget *parentWidget = nullptr; int row = -1; if (!afterItem) { row = 0; @@ -194,8 +194,8 @@ void QtGroupBoxPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, Qt if (!parentItem->groupBox) { m_recreateQueue.removeAll(parentItem); WidgetItem *par = parentItem->parent; - QWidget *w = 0; - QGridLayout *l = 0; + QWidget *w = nullptr; + QGridLayout *l = nullptr; int oldRow = -1; if (!par) { w = q_ptr; @@ -214,7 +214,7 @@ void QtGroupBoxPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, Qt if (parentItem->label) { l->removeWidget(parentItem->label); delete parentItem->label; - parentItem->label = 0; + parentItem->label = nullptr; } if (parentItem->widget) { l->removeWidget(parentItem->widget); @@ -224,7 +224,7 @@ void QtGroupBoxPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, Qt } else if (parentItem->widgetLabel) { l->removeWidget(parentItem->widgetLabel); delete parentItem->widgetLabel; - parentItem->widgetLabel = 0; + parentItem->widgetLabel = nullptr; } if (parentItem->line) { parentItem->line->setFrameShape(QFrame::HLine); @@ -300,7 +300,7 @@ void QtGroupBoxPropertyBrowserPrivate::propertyRemoved(QtBrowserItem *index) removeRow(parentItem->layout, row); } else { WidgetItem *par = parentItem->parent; - QGridLayout *l = 0; + QGridLayout *l = nullptr; int oldRow = -1; if (!par) { l = m_mainLayout; @@ -323,9 +323,9 @@ void QtGroupBoxPropertyBrowserPrivate::propertyRemoved(QtBrowserItem *index) } l->removeWidget(parentItem->groupBox); delete parentItem->groupBox; - parentItem->groupBox = 0; - parentItem->line = 0; - parentItem->layout = 0; + parentItem->groupBox = nullptr; + parentItem->line = nullptr; + parentItem->layout = nullptr; if (!m_recreateQueue.contains(parentItem)) m_recreateQueue.append(parentItem); updateLater(); diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp index 601fb854a..bc86d2879 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp @@ -423,7 +423,7 @@ void QtProperty::setModified(bool modified) */ void QtProperty::addSubProperty(QtProperty *property) { - QtProperty *after = 0; + QtProperty *after = nullptr; if (d_ptr->m_subItems.count() > 0) after = d_ptr->m_subItems.last(); insertSubProperty(property, after); @@ -468,7 +468,7 @@ void QtProperty::insertSubProperty(QtProperty *property, pendingList = subProperties(); int pos = 0; int newPos = 0; - QtProperty *properAfterProperty = 0; + QtProperty *properAfterProperty = nullptr; while (pos < pendingList.count()) { QtProperty *i = pendingList.at(pos); if (i == property) @@ -1365,7 +1365,7 @@ QtBrowserItem *QtAbstractPropertyBrowserPrivate::createBrowserIndex(QtProperty * q_ptr->itemInserted(newIndex, afterIndex); const auto subItems = property->subProperties(); - QtBrowserItem *afterChild = 0; + QtBrowserItem *afterChild = nullptr; for (QtProperty *child : subItems) afterChild = createBrowserIndex(child, newIndex, afterChild); return newIndex; @@ -1742,7 +1742,7 @@ void QtAbstractPropertyBrowser::clear() */ QtBrowserItem *QtAbstractPropertyBrowser::addProperty(QtProperty *property) { - QtProperty *afterProperty = 0; + QtProperty *afterProperty = nullptr; if (d_ptr->m_subItems.count() > 0) afterProperty = d_ptr->m_subItems.last(); return insertProperty(property, afterProperty); @@ -1849,7 +1849,7 @@ void QtAbstractPropertyBrowser::removeProperty(QtProperty *property) QWidget *QtAbstractPropertyBrowser::createEditor(QtProperty *property, QWidget *parent) { - QtAbstractEditorFactoryBase *factory = 0; + QtAbstractEditorFactoryBase *factory = nullptr; QtAbstractPropertyManager *manager = property->propertyManager(); if (m_viewToManagerToFactory()->contains(this) && diff --git a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp index fb77ee6eb..bcf9e1022 100644 --- a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp @@ -540,7 +540,7 @@ void QtTreePropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBrow QTreeWidgetItem *afterItem = m_indexToItem.value(afterIndex); QTreeWidgetItem *parentItem = m_indexToItem.value(index->parent()); - QTreeWidgetItem *newItem = 0; + QTreeWidgetItem *newItem = nullptr; if (parentItem) { newItem = new QTreeWidgetItem(parentItem, afterItem); } else { diff --git a/src/shared/qtpropertybrowser/qtvariantproperty.cpp b/src/shared/qtpropertybrowser/qtvariantproperty.cpp index 2c36d887b..c1a51044c 100644 --- a/src/shared/qtpropertybrowser/qtvariantproperty.cpp +++ b/src/shared/qtpropertybrowser/qtvariantproperty.cpp @@ -431,7 +431,7 @@ void QtVariantPropertyManagerPrivate::slotPropertyInserted(QtProperty *property, if (!varParent) return; - QtVariantProperty *varAfter = 0; + QtVariantProperty *varAfter = nullptr; if (after) { varAfter = m_internalToProperty.value(after, 0); if (!varAfter) @@ -1777,7 +1777,7 @@ void QtVariantPropertyManager::initializeProperty(QtProperty *property) QMap::ConstIterator it = d_ptr->m_typeToPropertyManager.find(d_ptr->m_propertyType); if (it != d_ptr->m_typeToPropertyManager.constEnd()) { - QtProperty *internProp = 0; + QtProperty *internProp = nullptr; if (!d_ptr->m_creatingSubProperties) { QtAbstractPropertyManager *manager = it.value(); internProp = manager->addProperty(); @@ -1786,7 +1786,7 @@ void QtVariantPropertyManager::initializeProperty(QtProperty *property) propertyToWrappedProperty()->insert(varProp, internProp); if (internProp) { const auto children = internProp->subProperties(); - QtVariantProperty *lastProperty = 0; + QtVariantProperty *lastProperty = nullptr; for (QtProperty *child : children) { QtVariantProperty *prop = d_ptr->createSubProperty(varProp, lastProperty, child); lastProperty = prop ? prop : lastProperty; diff --git a/src/shared/qttoolbardialog/qttoolbardialog.cpp b/src/shared/qttoolbardialog/qttoolbardialog.cpp index 3e069602c..4136a42c4 100644 --- a/src/shared/qttoolbardialog/qttoolbardialog.cpp +++ b/src/shared/qttoolbardialog/qttoolbardialog.cpp @@ -684,7 +684,7 @@ void QtFullToolBarManager::setToolBar(QToolBar *toolBar, const QList QList newActionsWithSeparators; for (QAction *action : qAsConst(newActions)) { - QAction *newAction = 0; + QAction *newAction = nullptr; if (!action) newAction = toolBar->insertSeparator(0); if (d_ptr->allActions.contains(action)) { @@ -1076,8 +1076,8 @@ void QtToolBarDialogPrivate::clearOld() qDeleteAll(allToolBarItems); allToolBarItems.clear(); - currentToolBar = 0; - currentAction = 0; + currentToolBar = nullptr; + currentAction = nullptr; } void QtToolBarDialogPrivate::fillNew() @@ -1413,7 +1413,7 @@ void QtToolBarDialogPrivate::rightClicked() QListWidgetItem *currentToolBarAction = ui.currentToolBarList->currentItem(); QAction *action = itemToAction.value(currentAction); - QListWidgetItem *item = 0; + QListWidgetItem *item = nullptr; if (action) { if (currentState[currentToolBar].contains(action)) { item = actionToCurrentItem.value(action); @@ -1499,7 +1499,7 @@ void QtToolBarDialogPrivate::currentToolBarChanged(QListWidgetItem *current) return; } const auto actions = currentState.value(currentToolBar); - QListWidgetItem *first = 0; + QListWidgetItem *first = nullptr; for (QAction *action : actions) { QString actionName = separatorText; if (action) -- cgit v1.2.3