diff options
Diffstat (limited to 'tests/auto/widgets')
20 files changed, 51 insertions, 51 deletions
diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 62286d703f..259de49c67 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -338,7 +338,7 @@ class SelfDestructParent : public QWidget Q_OBJECT public: explicit SelfDestructParent(int delay = 100) - : QWidget(Q_NULLPTR) + : QWidget(nullptr) { QTimer::singleShot(delay, this, SLOT(deleteLater())); } diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 7a7cfb5704..50f87b2c70 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -134,10 +134,10 @@ class ExecCloseHelper : public QObject public: enum { CloseWindow = -1 }; - explicit ExecCloseHelper(QObject *parent = Q_NULLPTR) - : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(Q_NULLPTR) { } + explicit ExecCloseHelper(QObject *parent = nullptr) + : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(nullptr) { } - void start(int key, QWidget *testCandidate = Q_NULLPTR) + void start(int key, QWidget *testCandidate = nullptr) { m_key = key; m_testCandidate = testCandidate; @@ -172,7 +172,7 @@ void ExecCloseHelper::timerEvent(QTimerEvent *te) QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier); QCoreApplication::postEvent(m_testCandidate, ke); } - m_testCandidate = Q_NULLPTR; + m_testCandidate = nullptr; killTimer(m_timerId); m_timerId = m_key = 0; } diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 96827022a8..63fe2e6cb4 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -1110,11 +1110,11 @@ void tst_QGraphicsItem::visible() scene.addItem(item); QVERIFY(item->isVisible()); - QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item); item->setVisible(false); QVERIFY(scene.items(QPointF(0, 0)).isEmpty()); item->setVisible(true); - QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item); QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); event.setButton(Qt::LeftButton); @@ -5503,16 +5503,16 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2() QGraphicsScene scene; scene.addItem(parent); - QCOMPARE(scene.items(QPointF(5, 5)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); + QCOMPARE(scene.items(QPointF(5, 5)).value(0, nullptr), (QGraphicsItem *)parent); QVERIFY(scene.items(QPointF(15, 5)).isEmpty()); QVERIFY(scene.items(QPointF(5, 15)).isEmpty()); QVERIFY(scene.items(QPointF(60, 60)).isEmpty()); QVERIFY(scene.items(QPointF(140, 60)).isEmpty()); QVERIFY(scene.items(QPointF(60, 140)).isEmpty()); QVERIFY(scene.items(QPointF(140, 140)).isEmpty()); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child2); - QCOMPARE(scene.items(QPointF(75, 100)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); - QCOMPARE(scene.items(QPointF(100, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child2); + QCOMPARE(scene.items(QPointF(75, 100)).value(0, nullptr), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(100, 75)).value(0, nullptr), (QGraphicsItem *)child1); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); image.fill(0); @@ -5547,9 +5547,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3() grandchild->setPos( 50, 50 ); parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child); - QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)parent); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild); QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); // Move child to fully overlap the parent. The grandchild should @@ -5557,9 +5557,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3() child->prepareGeometryChange(); child->setPos( 0, 0 ); - QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)child); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); - QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild); QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); } @@ -5832,8 +5832,8 @@ void tst_QGraphicsItem::itemClippingDiscovery() rightRectItem->setParentItem(clipItem); // The rects item are both visible at these points. - QCOMPARE(scene.items(QPointF(10, 10)).value(0, Q_NULLPTR), (QGraphicsItem *)leftRectItem); - QCOMPARE(scene.items(QPointF(90, 90)).value(0, Q_NULLPTR), (QGraphicsItem *)rightRectItem); + QCOMPARE(scene.items(QPointF(10, 10)).value(0, nullptr), (QGraphicsItem *)leftRectItem); + QCOMPARE(scene.items(QPointF(90, 90)).value(0, nullptr), (QGraphicsItem *)rightRectItem); // The ellipse clips the rects now. clipItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape); @@ -5873,7 +5873,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // First test that both items are searched if no optimization flags are set - QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, nullptr); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5884,7 +5884,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // Repeat the test to make sure that no caching/indexing is in effect - item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + item = scene.items(QPointF(25, 5)).value(0, nullptr); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5897,7 +5897,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() // Set the optimization flag and make sure that the child is not returned // and that the child's boundingRect() method is never called. parent->setFlag(QGraphicsItem::ItemContainsChildrenInShape); - item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + item = scene.items(QPointF(25, 5)).value(0, nullptr); QVERIFY(!(item)); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 7615c5e821..6e4da153d2 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -295,7 +295,7 @@ void tst_QGraphicsScene::construction() static inline const QGraphicsItem *itemAt(const QGraphicsScene &scene, qreal x, qreal y) { - return scene.items(QPointF(x, y)).value(0, Q_NULLPTR); + return scene.items(QPointF(x, y)).value(0, nullptr); } void tst_QGraphicsScene::sceneRect() diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index a3c6805c7e..85b42e54fe 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -2059,10 +2059,10 @@ void tst_QGraphicsWidget::task236127_bspTreeIndexFails() QTRY_VERIFY(scene.items(QPointF(25, 25)).isEmpty()); widget->setGeometry(0, 112, 360, 528); - QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget); widget2->setGeometry(0, 573, 360, 67); - QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); - QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, Q_NULLPTR), (QGraphicsItem *)widget2); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, nullptr), (QGraphicsItem *)widget2); } void tst_QGraphicsWidget::defaultSize() diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index b9785c35ac..11bd118e4b 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -288,7 +288,7 @@ public: class ScrollPerItemListView : public QListView { public: - explicit ScrollPerItemListView(QWidget *parent = Q_NULLPTR) + explicit ScrollPerItemListView(QWidget *parent = nullptr) : QListView(parent) { // Force per item scroll mode since it comes from the style by default diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index fa7f9596da..3317c79daa 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -3449,7 +3449,7 @@ void tst_QTreeWidget::getMimeDataWithInvalidItem() { CustomTreeWidget w; QTest::ignoreMessage(QtWarningMsg, "QTreeWidget::mimeData: Null-item passed"); - QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << Q_NULLPTR); + QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << nullptr); QVERIFY(!md); } diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp index ac6362168e..2eb8c17359 100644 --- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp @@ -350,7 +350,7 @@ void tst_QAction::enabledVisibleInteraction() void tst_QAction::task200823_tooltip() { - const QScopedPointer<QAction> action(new QAction("foo", Q_NULLPTR)); + const QScopedPointer<QAction> action(new QAction("foo", nullptr)); QString shortcut("ctrl+o"); action->setShortcut(shortcut); @@ -364,7 +364,7 @@ void tst_QAction::task200823_tooltip() void tst_QAction::task229128TriggeredSignalWithoutActiongroup() { // test without a group - const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", Q_NULLPTR)); + const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", nullptr)); QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), SIGNAL(triggered(bool))); QCOMPARE(spyWithoutGroup.count(), 0); actionWithoutGroup->trigger(); diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 6ff38abdb8..c70ac0309f 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -2214,7 +2214,7 @@ void tst_QApplication::staticFunctions() QApplication::activeModalWidget(); QApplication::focusWidget(); QApplication::activeWindow(); - QApplication::setActiveWindow(Q_NULLPTR); + QApplication::setActiveWindow(nullptr); QApplication::widgetAt(QPoint(0, 0)); QApplication::topLevelAt(QPoint(0, 0)); QApplication::setGlobalStrut(QSize(0, 0)); diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp index 0b35db1b5f..c39c770316 100644 --- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp @@ -297,7 +297,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){ layout.setObjectName("ef9e2b42298e0e6420105bb"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QVBoxLayout/ef9e2b42298e0e6420105bb"); - layout.addWidget(Q_NULLPTR); + layout.addWidget(nullptr); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/347b469225a24a0ef05150a to its child layout QVBoxLayout/ef9e2b42298e0e6420105bb"); @@ -313,7 +313,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){ layout.setObjectName("cc751dd0f50f62b05a62da"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QVBoxLayout/cc751dd0f50f62b05a62da"); - layout.addLayout(Q_NULLPTR); + layout.addLayout(nullptr); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QVBoxLayout/cc751dd0f50f62b05a62da to itself"); diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp index c1ab5f51be..50de83c8f7 100644 --- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp @@ -342,7 +342,7 @@ void tst_QGridLayout::setMinAndMaxSize() layout.removeItem(spacer); delete spacer; - spacer = Q_NULLPTR; + spacer = nullptr; rightChild.hide(); QApplication::sendPostedEvents(0, 0); @@ -1630,7 +1630,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){ layout.setObjectName("d631e91a35f2b66a6dff35"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QGridLayout/d631e91a35f2b66a6dff35"); - layout.addWidget(Q_NULLPTR, 0, 0); + layout.addWidget(nullptr, 0, 0); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/9bb37ca762aeb7269b8 to its child layout QGridLayout/d631e91a35f2b66a6dff35"); @@ -1645,7 +1645,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){ layout.setObjectName("5d79e1b0aed83f100e3c2"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QGridLayout/5d79e1b0aed83f100e3c2"); - layout.addLayout(Q_NULLPTR, 0, 0); + layout.addLayout(nullptr, 0, 0); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QGridLayout/5d79e1b0aed83f100e3c2 to itself"); diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp index d50f46cc16..eb3264be53 100644 --- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp +++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp @@ -60,7 +60,7 @@ private: struct PrettyPrint { const char *m_s; template <typename T> - explicit PrettyPrint(const T &t) : m_s(Q_NULLPTR) + explicit PrettyPrint(const T &t) : m_s(nullptr) { using QT_PREPEND_NAMESPACE(QTest)::toString; m_s = toString(t); diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index c163117ef3..86736bb082 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -129,7 +129,7 @@ static QWidget *findWhatsThat() if (widget->inherits("QWhatsThat")) return widget; } - return Q_NULLPTR; + return nullptr; } void tst_QToolTip::whatsThis() @@ -137,7 +137,7 @@ void tst_QToolTip::whatsThis() qApp->setStyleSheet( "QWidget { font-size: 72px; }" ); QWhatsThis::showText(QPoint(0, 0), "This is text"); - QWidget *whatsthis = Q_NULLPTR; + QWidget *whatsthis = nullptr; QTRY_VERIFY( (whatsthis = findWhatsThat()) ); QVERIFY(whatsthis->isVisible()); const int whatsThisHeight = whatsthis->height(); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 0ec8c6d9b1..6fcf6dc3ed 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -10334,7 +10334,7 @@ public slots: QTimer::singleShot(100, this, SLOT(doMouseMoves())); modal->exec(); delete modal; - modal = Q_NULLPTR; + modal = nullptr; } void doMouseMoves() diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index 6dabc06b6d..a158b6cbc9 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -218,7 +218,7 @@ class PaintTestWidget : public QWidget public: int paintEventCount; - explicit PaintTestWidget(QWidget *parent = Q_NULLPTR) + explicit PaintTestWidget(QWidget *parent = nullptr) : QWidget(parent) , paintEventCount(0) {} diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index f9c6b4c966..30177dfa86 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -779,7 +779,7 @@ class TestStyleOptionInitProxy: public QProxyStyle Q_OBJECT public: mutable bool invalidOptionsDetected; - explicit TestStyleOptionInitProxy(QStyle *style = Q_NULLPTR) + explicit TestStyleOptionInitProxy(QStyle *style = nullptr) : QProxyStyle(style), invalidOptionsDetected(false) {} @@ -846,7 +846,7 @@ public: private: void checkStyle(const QByteArray &info, const QStyleOption *opt) const { - if (opt && (opt->version == 0 || opt->styleObject == Q_NULLPTR) ) { + if (opt && (opt->version == 0 || opt->styleObject == nullptr) ) { invalidOptionsDetected = true; qWarning() << baseStyle()->metaObject()->className() << "Invalid QStyleOption found for" diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 2f4e1a32f3..3415d06bc6 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -3277,7 +3277,7 @@ void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated() class QTBUG_56693_Model : public QStandardItemModel { public: - QTBUG_56693_Model(QObject *parent = Q_NULLPTR) + QTBUG_56693_Model(QObject *parent = nullptr) : QStandardItemModel(parent) { } @@ -3305,7 +3305,7 @@ public: } - void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = Q_NULLPTR) const override + void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override { if (element == CE_MenuItem) if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 105ace8d97..b865a10874 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -3068,7 +3068,7 @@ void tst_QLineEdit::cutWithoutSelection() QClipboard *clipboard = QGuiApplication::clipboard(); if (!PlatformClipboard::isAvailable() || !QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) { // Avoid unstable X11 clipboard - clipboard = Q_NULLPTR; + clipboard = nullptr; } if (clipboard) @@ -4497,7 +4497,7 @@ template <class T> T *findAssociatedWidget(const QAction *a) if (T *result = qobject_cast<T *>(w)) return result; } - return Q_NULLPTR; + return nullptr; } void tst_QLineEdit::sideWidgetsActionEvents() diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index b0ec4a55f4..4408533c85 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -617,7 +617,7 @@ static QMenu *getTornOffMenu() if (w->isVisible() && w->inherits("QTornOffMenu")) return static_cast<QMenu *>(w); } - return Q_NULLPTR; + return nullptr; } void tst_QMenu::tearOff() diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index 9a0ca0565e..789ea57dfc 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -1494,7 +1494,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() //set the new parent, a window QScopedPointer<QWidget> windowedParent; - windowedParent.reset(new QWidget(Q_NULLPTR, Qt::WindowFlags())); + windowedParent.reset(new QWidget(nullptr, Qt::WindowFlags())); windowedParent->setGeometry(400, 10, 300, 300); windowedParent->show(); @@ -1511,7 +1511,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() //to windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar movingParent.setParent(windowedParent.data(),0); // this resets the parenting and the menu bar's window - taskQTBUG53205MenuBar->setParent(Q_NULLPTR); + taskQTBUG53205MenuBar->setParent(nullptr); taskQTBUG53205MenuBar->setParent(&containedWidget); //from windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar //to : QMainWindow<-hiddenParent<-movingParent<-containerWidget<-containedWidget<-menuBar @@ -1543,7 +1543,7 @@ void tst_QMenuBar::platformMenu() void tst_QMenuBar::slotForTaskQTBUG53205() { QWidget *parent = taskQTBUG53205MenuBar->parentWidget(); - taskQTBUG53205MenuBar->setParent(Q_NULLPTR); + taskQTBUG53205MenuBar->setParent(nullptr); taskQTBUG53205MenuBar->setParent(parent); } |