diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-08-06 03:55:27 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-08-06 03:55:27 (GMT) |
commit | 06d57fc65c47d12047e985202ae1e394c48f78ca (patch) | |
tree | a897a8f91ad5e919e7cc66671b60d83248c96e72 /tests/auto/qlistwidget | |
parent | 31fa1d0f6144e7e92748b33f8633eeb2f52483a1 (diff) | |
parent | 56b349951a70f3ab95e334e41e37f017e91cf481 (diff) | |
download | Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.zip Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.tar.gz Qt-06d57fc65c47d12047e985202ae1e394c48f78ca.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/gui/dialogs/qfiledialog.cpp
src/gui/dialogs/qfiledialog_win.cpp
tests/auto/qicoimageformat/tst_qicoimageformat.cpp
tests/auto/qscriptqobject/qscriptqobject.pro
Diffstat (limited to 'tests/auto/qlistwidget')
-rw-r--r-- | tests/auto/qlistwidget/tst_qlistwidget.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index e581bd3..422c7d5 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -128,6 +128,8 @@ private slots: void setSortingEnabled(); void task199503_crashWhenCleared(); void task217070_scrollbarsAdjusted(); + void task258949_keypressHangup(); + protected slots: void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last) @@ -1009,7 +1011,7 @@ void tst_QListWidget::sortHiddenItems() for (int k = 0; k < tw->count(); ++k) QCOMPARE(persistent.at(k).row(), expectedRows.at(k)); - + delete tw; } @@ -1513,5 +1515,24 @@ void tst_QListWidget::task217070_scrollbarsAdjusted() } } +void tst_QListWidget::task258949_keypressHangup() +{ + QListWidget lw; + for (int y = 0; y < 5; y++) { + QListWidgetItem *lwi = new QListWidgetItem(&lw); + lwi->setText(y ? "1" : "0"); + if (y) + lwi->setFlags(Qt::ItemIsSelectable); + } + + lw.show(); + lw.setCurrentIndex(lw.model()->index(0,0)); + QCOMPARE(lw.currentIndex(), lw.model()->index(0,0)); + QTest::qWait(30); + QTest::keyPress(&lw, '1'); //this used to freeze + QTest::qWait(30); + QCOMPARE(lw.currentIndex(), lw.model()->index(0,0)); +} + QTEST_MAIN(tst_QListWidget) #include "tst_qlistwidget.moc" |