Fix QTreeWidget autotest

Change-Id: I94b4d9d2f0ef013691faedc4cd12050aa49e98f2
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
This commit is contained in:
Fabian Bumberger 2014-04-03 15:17:41 +02:00 committed by The Qt Project
parent 495c4d501e
commit f3eb59e3fc

View File

@ -3092,9 +3092,14 @@ void tst_QTreeWidget::task253109_itemHeight()
void tst_QTreeWidget::task206367_duplication()
{
QWidget topLevel;
// Explicitly set the font size because it is dpi dependent on some platforms
QFont font;
font.setPixelSize(40);
topLevel.setFont(font);
QTreeWidget treeWidget(&topLevel);
topLevel.show();
treeWidget.resize(200, 200);
treeWidget.setHeaderHidden(true);
treeWidget.setSortingEnabled(true);
QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") );
@ -3105,10 +3110,9 @@ void tst_QTreeWidget::task206367_duplication()
itemFile->setExpanded(true);
}
rootItem->setExpanded(true);
QTest::qWait(2000);
//there should be enough room for 2x2 items. If there is a scrollbar, it means the items are duplicated
QVERIFY(!treeWidget.verticalScrollBar()->isVisible());
QTRY_VERIFY(!treeWidget.verticalScrollBar()->isVisible());
}