diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-09-30 15:16:55 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-11-30 07:24:47 +0000 |
commit | 2fd3d8ea9e3e1829653942431070a83569bab6eb (patch) | |
tree | 7803eed14bf3064b4d2c1420c0f0c94482463b6d /tests/auto/widgets/graphicsview/qgraphicsgridlayout | |
parent | 97b8fdab7d3604294476bf566b024ecbd5b412b0 (diff) |
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsgridlayout')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index f5b2269297..9d4b640272 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -1073,7 +1073,7 @@ void tst_QGraphicsGridLayout::itemAt() } else { const QByteArray message = "QGraphicsGridLayout::itemAt: invalid index " + QByteArray::number(i); QTest::ignoreMessage(QtWarningMsg, message.constData()); - QCOMPARE(layout->itemAt(i), static_cast<QGraphicsLayoutItem*>(0)); + QCOMPARE(layout->itemAt(i), nullptr); } } delete widget; @@ -1102,7 +1102,7 @@ void tst_QGraphicsGridLayout::removeAt() QGraphicsLayoutItem *item0 = layout->itemAt(0); QCOMPARE(item0->parentLayoutItem(), static_cast<QGraphicsLayoutItem *>(layout)); layout->removeAt(0); - QCOMPARE(item0->parentLayoutItem(), static_cast<QGraphicsLayoutItem *>(0)); + QCOMPARE(item0->parentLayoutItem(), nullptr); QCOMPARE(layout->count(), 0); QTest::ignoreMessage(QtWarningMsg, QString::fromLatin1("QGraphicsGridLayout::removeAt: invalid index 0").toLatin1().constData()); layout->removeAt(0); |