summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlistwidget/tst_qlistwidget.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-10 06:56:35 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-10 06:56:35 (GMT)
commitf61ec84fc296c6f70011e30788ee511d6b6a18c6 (patch)
tree54b3b81ac83570e65dc9b44b6756005f6ba1efde /tests/auto/qlistwidget/tst_qlistwidget.cpp
parentcc0a411e5e874aa224c26298a109973cb15ea291 (diff)
parentd13418effc5f00474541ae513a30c9a42c2a1cb3 (diff)
downloadQt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.zip
Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.gz
Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.bz2
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/qlistwidget/tst_qlistwidget.cpp')
-rw-r--r--tests/auto/qlistwidget/tst_qlistwidget.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp
index 6f49a37..d2bc90a 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;
}
@@ -1517,5 +1519,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"