summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcompleter
diff options
context:
space:
mode:
authorNoah White-Hamerslough <noah@pcc.com>2009-07-13 16:58:48 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-13 17:02:54 (GMT)
commitc549bda8cd38a099118f3cf4c7e5462010cb7259 (patch)
tree9367d950e5f05109de759bff1cc08751cfdc35b5 /tests/auto/qcompleter
parent1cea2ed930377b1bb0d1ce583eacae87d999fc16 (diff)
downloadQt-c549bda8cd38a099118f3cf4c7e5462010cb7259.zip
Qt-c549bda8cd38a099118f3cf4c7e5462010cb7259.tar.gz
Qt-c549bda8cd38a099118f3cf4c7e5462010cb7259.tar.bz2
Fixes: The keyboard navigation of QComboBox don't work with the completion
Merge-request: 653 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com> Task-number: 247560
Diffstat (limited to 'tests/auto/qcompleter')
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index baea419..bbc01cc 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -146,6 +146,8 @@ private slots:
void task253125_lineEditCompletion_data();
void task253125_lineEditCompletion();
+ void task247560_keyboardNavigation();
+
private:
void filter();
void testRowCount();
@@ -1230,5 +1232,43 @@ void tst_QCompleter::task253125_lineEditCompletion()
QCOMPARE(edit.text(), QString("iota"));
}
+void tst_QCompleter::task247560_keyboardNavigation()
+{
+ QStandardItemModel model;
+
+ for (int i = 0; i < 5; i++) {
+ for (int j = 0; j < 5; j++) {
+ model.setItem(i, j, new QStandardItem(QString("row %1 column %2").arg(i).arg(j)));
+ }
+ }
+
+
+ QCompleter completer(&model);
+ completer.setCompletionColumn(1);
+
+ QLineEdit edit;
+ edit.setCompleter(&completer);
+ edit.show();
+ edit.setFocus();
+
+ QTest::qWait(100);
+
+ QTest::keyClick(&edit, 'r');
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Down);
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Down);
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Enter);
+
+ QCOMPARE(edit.text(), QString("row 1 column 1"));
+
+ edit.clear();
+
+ QTest::keyClick(&edit, 'r');
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Up);
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Up);
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Enter);
+
+ QCOMPARE(edit.text(), QString("row 3 column 1"));
+}
+
QTEST_MAIN(tst_QCompleter)
#include "tst_qcompleter.moc"