summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcombobox/tst_qcombobox.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-10 08:56:35 +0200
committerJason Barron <jbarron@trolltech.com>2009-08-10 08:56:35 +0200
commitf61ec84fc296c6f70011e30788ee511d6b6a18c6 (patch)
tree54b3b81ac83570e65dc9b44b6756005f6ba1efde /tests/auto/qcombobox/tst_qcombobox.cpp
parentcc0a411e5e874aa224c26298a109973cb15ea291 (diff)
parentd13418effc5f00474541ae513a30c9a42c2a1cb3 (diff)
Merge commit 'qt/master-stable'
Conflicts: src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer_impl.h src/gui/widgets/qdatetimeedit.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlineedit.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qicoimageformat/tst_qicoimageformat.cpp tests/auto/qmultiscreen/qmultiscreen.pro tests/auto/qresourceengine/qresourceengine.pro tests/auto/qresourceengine/tst_qresourceengine.cpp tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
Diffstat (limited to 'tests/auto/qcombobox/tst_qcombobox.cpp')
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 0ed02f11bd..9ecfe3956d 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -139,6 +139,7 @@ private slots:
void task190205_setModelAdjustToContents();
void task248169_popupWithMinimalSize();
void task247863_keyBoardSelection();
+ void task220195_keyBoardSelection2();
void setModelColumn();
void noScrollbar_data();
void noScrollbar();
@@ -2095,7 +2096,7 @@ void tst_QComboBox::task190205_setModelAdjustToContents()
#endif
// box should be resized to the same size as correctBox
- QCOMPARE(box.size(), correctBox.size());
+ QTRY_COMPARE(box.size(), correctBox.size());
}
void tst_QComboBox::task248169_popupWithMinimalSize()
@@ -2141,6 +2142,40 @@ void tst_QComboBox::task247863_keyBoardSelection()
QCOMPARE(spy.count(), 1);
}
+void tst_QComboBox::task220195_keyBoardSelection2()
+{
+ QComboBox combo;
+ combo.setEditable(false);
+ combo.addItem( QLatin1String("foo1"));
+ combo.addItem( QLatin1String("foo2"));
+ combo.addItem( QLatin1String("foo3"));
+ combo.show();
+ QApplication::setActiveWindow(&combo);
+ QTest::qWait(100);
+
+ combo.setCurrentIndex(-1);
+ QVERIFY(combo.currentText().isNull());
+
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo1"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo2"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo3"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo1"));
+ QTest::qWait(QApplication::keyboardInputInterval() + 30);
+
+ combo.setCurrentIndex(1);
+ QCOMPARE(combo.currentText(), QLatin1String("foo2"));
+ QTest::keyClick(&combo, 'f');
+ QCOMPARE(combo.currentText(), QLatin1String("foo3"));
+}
+
+
void tst_QComboBox::setModelColumn()
{
QStandardItemModel model(5,3);
@@ -2241,5 +2276,6 @@ void tst_QComboBox::task253944_itemDelegateIsReset()
QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate);
}
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"