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/widgets/qcombobox/tst_qcombobox.cpp | |
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/widgets/qcombobox/tst_qcombobox.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index edaf033678..122d320d18 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -305,17 +305,17 @@ void tst_QComboBox::getSetCheck() obj1.setValidator(var9); QCOMPARE(obj1.validator(), (const QValidator *)var9); obj1.setValidator((QValidator *)0); - QCOMPARE(obj1.validator(), (const QValidator *)0); + QCOMPARE(obj1.validator(), nullptr); delete var9; // QAbstractItemDelegate * QComboBox::itemDelegate() // void QComboBox::setItemDelegate(QAbstractItemDelegate *) MyAbstractItemDelegate *var10 = new MyAbstractItemDelegate; obj1.setItemDelegate(var10); - QCOMPARE(obj1.itemDelegate(), (QAbstractItemDelegate *)var10); + QCOMPARE(obj1.itemDelegate(), nullptr); QTest::ignoreMessage(QtWarningMsg, "QComboBox::setItemDelegate: cannot set a 0 delegate"); obj1.setItemDelegate((QAbstractItemDelegate *)0); - QCOMPARE(obj1.itemDelegate(), (QAbstractItemDelegate *)var10); + QCOMPARE(obj1.itemDelegate(), nullptr); // delete var10; // No delete, since QComboBox takes ownership // QAbstractItemModel * QComboBox::model() |