Stabilize QListWidget test

Shot in the dark, as usual.

Change-Id: I272392e6d865f6b32047c3a0ebad70c0f007ba58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Marc Mutz 2014-04-07 09:36:49 +02:00 committed by The Qt Project
parent f51cbc9e17
commit 509428decc

View File

@ -317,13 +317,7 @@ void tst_QListWidget::closePersistentEditor()
// actual test
childCount = testWidget->viewport()->children().count();
testWidget->closePersistentEditor(item);
// Spin the event loop and hopefully it will die.
QEventLoop eventLoop;
for (int i=0; i < childCount; ++i)
connect(testWidget->viewport()->children().at(i), SIGNAL(destroyed()), &eventLoop, SLOT(quit()));
QTimer::singleShot(100, &eventLoop, SLOT(quit()));
eventLoop.exec();
QCOMPARE(testWidget->viewport()->children().count(), childCount - 1);
QTRY_COMPARE(testWidget->viewport()->children().count(), childCount - 1);
}
void tst_QListWidget::setItemHidden()