diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 13:05:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 23:02:47 +0200 |
commit | 564b59d903683b14c75b72a3e93367717f201def (patch) | |
tree | 03ffe749d83dce84429a7db484bf92795047036f /src/widgets/widgets/qmainwindowlayout.cpp | |
parent | b5fc1e4e2643e73d3b44c483d159529f8deb8af1 (diff) |
Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.
Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 76d9a33e06..95ee90eb31 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -646,7 +646,7 @@ QSize QMainWindowLayoutState::sizeHint() const #if QT_CONFIG(dockwidget) result = dockAreaLayout.sizeHint(); #else - if (centralWidgetItem != 0) + if (centralWidgetItem) result = centralWidgetItem->sizeHint(); #endif @@ -664,7 +664,7 @@ QSize QMainWindowLayoutState::minimumSize() const #if QT_CONFIG(dockwidget) result = dockAreaLayout.minimumSize(); #else - if (centralWidgetItem != 0) + if (centralWidgetItem) result = centralWidgetItem->minimumSize(); #endif @@ -685,9 +685,9 @@ void QMainWindowLayoutState::apply(bool animated) // dumpLayout(dockAreaLayout, QString()); dockAreaLayout.apply(animated); #else - if (centralWidgetItem != 0) { + if (centralWidgetItem) { QMainWindowLayout *layout = qt_mainwindow_layout(mainWindow); - Q_ASSERT(layout != 0); + Q_ASSERT(layout); layout->widgetAnimator.animate(centralWidgetItem->widget(), centralWidgetRect, animated); } #endif @@ -744,7 +744,7 @@ QLayoutItem *QMainWindowLayoutState::itemAt(int index, int *x) const if (QLayoutItem *ret = dockAreaLayout.itemAt(x, index)) return ret; #else - if (centralWidgetItem != 0 && (*x)++ == index) + if (centralWidgetItem && (*x)++ == index) return centralWidgetItem; #endif @@ -762,9 +762,9 @@ QLayoutItem *QMainWindowLayoutState::takeAt(int index, int *x) if (QLayoutItem *ret = dockAreaLayout.takeAt(x, index)) return ret; #else - if (centralWidgetItem != 0 && (*x)++ == index) { + if (centralWidgetItem && (*x)++ == index) { QLayoutItem *ret = centralWidgetItem; - centralWidgetItem = 0; + centralWidgetItem = nullptr; return ret; } #endif @@ -807,7 +807,7 @@ bool QMainWindowLayoutState::contains(QWidget *widget) const if (!dockAreaLayout.indexOf(widget).isEmpty()) return true; #else - if (centralWidgetItem != 0 && centralWidgetItem->widget() == widget) + if (centralWidgetItem && centralWidgetItem->widget() == widget) return true; #endif @@ -856,7 +856,7 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget, #if QT_CONFIG(toolbar) // is it a toolbar? - if (qobject_cast<QToolBar*>(widget) != 0) { + if (qobject_cast<QToolBar*>(widget) != nullptr) { result = toolBarAreaLayout.gapIndex(pos); if (!result.isEmpty()) result.prepend(0); @@ -866,7 +866,7 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget, #if QT_CONFIG(dockwidget) // is it a dock widget? - if (qobject_cast<QDockWidget *>(widget) != 0 + if (qobject_cast<QDockWidget *>(widget) != nullptr || qobject_cast<QDockWidgetGroupWindow *>(widget)) { bool disallowTabs = false; #if QT_CONFIG(tabbar) @@ -894,7 +894,7 @@ bool QMainWindowLayoutState::insertGap(const QList<int> &path, QLayoutItem *item #if QT_CONFIG(toolbar) if (i == 0) { - Q_ASSERT(qobject_cast<QToolBar*>(item->widget()) != 0); + Q_ASSERT(qobject_cast<QToolBar*>(item->widget()) != nullptr); return toolBarAreaLayout.insertGap(path.mid(1), item); } #endif @@ -2155,7 +2155,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem) QRect globalRect = currentGapRect; globalRect.moveTopLeft(parentWidget()->mapToGlobal(globalRect.topLeft())); #if QT_CONFIG(dockwidget) - if (qobject_cast<QDockWidget*>(widget) != 0) { + if (qobject_cast<QDockWidget*>(widget) != nullptr) { QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(widget->layout()); if (layout->nativeWindowDeco()) { globalRect.adjust(0, layout->titleHeight(), 0, 0); @@ -2262,7 +2262,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) #if QT_CONFIG(dockwidget) #if QT_CONFIG(tabbar) - if (qobject_cast<QDockWidget*>(widget) != 0) { + if (qobject_cast<QDockWidget*>(widget) != nullptr) { // info() might return null if the widget is destroyed while // animating but before the animationFinished signal is received. if (QDockAreaLayoutInfo *info = dockInfo(widget)) |