diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index c934f8e27b..10430e1796 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1209,7 +1209,6 @@ void tst_QComboBox::currentIndex() // spy on currentIndexChanged QSignalSpy indexChangedInt(testWidget, SIGNAL(currentIndexChanged(int))); - QSignalSpy indexChangedString(testWidget, SIGNAL(currentIndexChanged(QString))); // stuff items into it foreach(QString text, initialItems) { @@ -1234,15 +1233,11 @@ void tst_QComboBox::currentIndex() // check that signal count is correct QCOMPARE(indexChangedInt.count(), expectedSignalCount); - QCOMPARE(indexChangedString.count(), expectedSignalCount); // compare with last sent signal values if (indexChangedInt.count()) QCOMPARE(indexChangedInt.at(indexChangedInt.count() - 1).at(0).toInt(), testWidget->currentIndex()); - if (indexChangedString.count()) - QCOMPARE(indexChangedString.at(indexChangedString.count() - 1).at(0).toString(), - testWidget->currentText()); if (edit) { testWidget->setCurrentIndex(-1); @@ -2486,7 +2481,7 @@ void tst_QComboBox::task247863_keyBoardSelection() QApplication::setActiveWindow(&combo); QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo)); - QSignalSpy spy(&combo, SIGNAL(activated(QString))); + QSignalSpy spy(&combo, &QComboBox::activated); qApp->setEffectEnabled(Qt::UI_AnimateCombo, false); QTest::keyClick(&combo, Qt::Key_Space); qApp->setEffectEnabled(Qt::UI_AnimateCombo, true); @@ -2767,7 +2762,7 @@ void tst_QComboBox::resetModel() }; QComboBox cb; StringListModel model({"1", "2"}); - QSignalSpy spy(&cb, QOverload<int>::of(&QComboBox::currentIndexChanged)); + QSignalSpy spy(&cb, &QComboBox::currentIndexChanged); QCOMPARE(spy.count(), 0); QCOMPARE(cb.currentIndex(), -1); //no selection |