From 2fd3d8ea9e3e1829653942431070a83569bab6eb Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Sep 2016 15:16:55 +0200 Subject: tests/auto/widgets: use QCOMPARE(., nullptr) .. instead of manually casted 0s. QCOMPARE(., nullptr) was added for Qt 5.8. Make use of the new API. In tst_qwidget.cpp, as a drive-by, change qApp->focusWidget() -> QApplication::focusWidget() Change-Id: I1331b8916b026d48e01534d1ed0b3d72f3f3d50c Reviewed-by: Friedemann Kleint --- tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/widgets/kernel/qstackedlayout') diff --git a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp index badeca69bb..835b6ca799 100644 --- a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp +++ b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp @@ -122,7 +122,7 @@ void tst_QStackedLayout::testCase() // Nothing in layout QCOMPARE(testLayout->currentIndex(), -1); - QCOMPARE(testLayout->currentWidget(), static_cast(0)); + QCOMPARE(testLayout->currentWidget(), nullptr); QCOMPARE(testLayout->count(), 0); // One widget added to layout @@ -163,7 +163,7 @@ void tst_QStackedLayout::testCase() QCOMPARE(spy.at(0).at(0).toInt(), -1); spy.clear(); QCOMPARE(testLayout->currentIndex(), -1); - QCOMPARE(testLayout->currentWidget(), static_cast(0)); + QCOMPARE(testLayout->currentWidget(), nullptr); QCOMPARE(testLayout->count(), 0); // Another widget inserted at current index. @@ -217,7 +217,7 @@ void tst_QStackedLayout::testCase() QVERIFY(w3->isVisible()); testLayout->removeWidget(w3); QCOMPARE(testLayout->currentIndex(), -1); - QCOMPARE(testLayout->currentWidget(), static_cast(0)); + QCOMPARE(testLayout->currentWidget(), nullptr); } void tst_QStackedLayout::deleteCurrent() -- cgit v1.2.3