diff options
Diffstat (limited to 'src/widgets/widgets/qtoolbararealayout.cpp')
-rw-r--r-- | src/widgets/widgets/qtoolbararealayout.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index adc329131c..493c094cc1 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -91,7 +91,7 @@ bool QToolBarAreaLayoutItem::skip() const { if (gap) return false; - return widgetItem == 0 || widgetItem->isEmpty(); + return widgetItem == nullptr || widgetItem->isEmpty(); } /****************************************************************************** @@ -302,7 +302,7 @@ QLayoutItem *QToolBarAreaLayoutInfo::insertToolBar(QToolBar *before, QToolBar *t void QToolBarAreaLayoutInfo::insertItem(QToolBar *before, QLayoutItem *item) { - if (before == 0) { + if (before == nullptr) { if (lines.isEmpty()) lines.append(QToolBarAreaLayoutLine(o)); lines.last().toolBarItems.append(item); @@ -330,7 +330,7 @@ void QToolBarAreaLayoutInfo::removeToolBar(QToolBar *toolBar) QToolBarAreaLayoutItem &item = line.toolBarItems[k]; if (item.widgetItem->widget() == toolBar) { delete item.widgetItem; - item.widgetItem = 0; + item.widgetItem = nullptr; line.toolBarItems.removeAt(k); if (line.toolBarItems.isEmpty() && j < lines.count() - 1) @@ -344,7 +344,7 @@ void QToolBarAreaLayoutInfo::removeToolBar(QToolBar *toolBar) void QToolBarAreaLayoutInfo::insertToolBarBreak(QToolBar *before) { - if (before == 0) { + if (before == nullptr) { if (!lines.isEmpty() && lines.constLast().toolBarItems.isEmpty()) return; lines.append(QToolBarAreaLayoutLine(o)); @@ -729,7 +729,7 @@ QRect QToolBarAreaLayout::rectHint(const QRect &r) const QLayoutItem *QToolBarAreaLayout::itemAt(int *x, int index) const { - Q_ASSERT(x != 0); + Q_ASSERT(x != nullptr); for (int i = 0; i < QInternal::DockCount; ++i) { const QToolBarAreaLayoutInfo &dock = docks[i]; @@ -744,12 +744,12 @@ QLayoutItem *QToolBarAreaLayout::itemAt(int *x, int index) const } } - return 0; + return nullptr; } QLayoutItem *QToolBarAreaLayout::takeAt(int *x, int index) { - Q_ASSERT(x != 0); + Q_ASSERT(x != nullptr); for (int i = 0; i < QInternal::DockCount; ++i) { QToolBarAreaLayoutInfo &dock = docks[i]; @@ -768,7 +768,7 @@ QLayoutItem *QToolBarAreaLayout::takeAt(int *x, int index) } } - return 0; + return nullptr; } void QToolBarAreaLayout::deleteAllLayoutItems() @@ -783,7 +783,7 @@ void QToolBarAreaLayout::deleteAllLayoutItems() QToolBarAreaLayoutItem &item = line.toolBarItems[k]; if (!item.gap) delete item.widgetItem; - item.widgetItem = 0; + item.widgetItem = nullptr; } } } @@ -811,7 +811,7 @@ QLayoutItem *QToolBarAreaLayout::insertToolBar(QToolBar *before, QToolBar *toolB { QInternal::DockPosition pos = findToolBar(before); if (pos == QInternal::DockCount) - return 0; + return nullptr; return docks[pos].insertToolBar(before, toolBar); } @@ -826,7 +826,7 @@ void QToolBarAreaLayout::removeToolBar(QToolBar *toolBar) QLayoutItem *QToolBarAreaLayout::addToolBar(QInternal::DockPosition pos, QToolBar *toolBar) { - return docks[pos].insertToolBar(0, toolBar); + return docks[pos].insertToolBar(nullptr, toolBar); } void QToolBarAreaLayout::insertToolBarBreak(QToolBar *before) @@ -847,7 +847,7 @@ void QToolBarAreaLayout::removeToolBarBreak(QToolBar *before) void QToolBarAreaLayout::addToolBarBreak(QInternal::DockPosition pos) { - docks[pos].insertToolBarBreak(0); + docks[pos].insertToolBarBreak(nullptr); } void QToolBarAreaLayout::moveToolBar(QToolBar *toolbar, int p) @@ -878,7 +878,7 @@ void QToolBarAreaLayout::insertItem(QToolBar *before, QLayoutItem *item) void QToolBarAreaLayout::apply(bool animate) { QMainWindowLayout *layout = qt_mainwindow_layout(mainWindow); - Q_ASSERT(layout != 0); + Q_ASSERT(layout != nullptr); Qt::LayoutDirection dir = mainWindow->layoutDirection(); @@ -1117,13 +1117,13 @@ QToolBarAreaLayoutItem *QToolBarAreaLayout::item(const QList<int> &path) Q_ASSERT(path.count() == 3); if (path.at(0) < 0 || path.at(0) >= QInternal::DockCount) - return 0; + return nullptr; QToolBarAreaLayoutInfo &info = docks[path.at(0)]; if (path.at(1) < 0 || path.at(1) >= info.lines.count()) - return 0; + return nullptr; QToolBarAreaLayoutLine &line = info.lines[path.at(1)]; if (path.at(2) < 0 || path.at(2) >= line.toolBarItems.count()) - return 0; + return nullptr; return &(line.toolBarItems[path.at(2)]); } @@ -1143,10 +1143,10 @@ QLayoutItem *QToolBarAreaLayout::plug(const QList<int> &path) QToolBarAreaLayoutItem *item = this->item(path); if (Q_UNLIKELY(!item)) { qWarning() << "No item at" << path; - return 0; + return nullptr; } Q_ASSERT(item->gap); - Q_ASSERT(item->widgetItem != 0); + Q_ASSERT(item->widgetItem != nullptr); item->gap = false; return item->widgetItem; } @@ -1352,14 +1352,14 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar* rect = unpackRect(geom0, geom1, &floating); } - QToolBar *toolBar = 0; + QToolBar *toolBar = nullptr; for (int x = 0; x < toolBars.count(); ++x) { if (toolBars.at(x)->objectName() == objectName) { toolBar = toolBars.takeAt(x); break; } } - if (toolBar == 0) { + if (toolBar == nullptr) { continue; } |