tests/auto/widgets/{effects,styles}: Avoid unconditional qWait()s
Task-number: QTBUG-63992 Change-Id: I1af537bae705d4627880c5ae50669b1ef72562f2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
8ac0e6592b
commit
73031ebb99
@ -365,9 +365,8 @@ void tst_QGraphicsEffect::draw()
|
|||||||
|
|
||||||
// Make sure we update the source when disabling/enabling the effect.
|
// Make sure we update the source when disabling/enabling the effect.
|
||||||
effect->setEnabled(false);
|
effect->setEnabled(false);
|
||||||
QTest::qWait(50);
|
QTRY_COMPARE(item->numRepaints, 1);
|
||||||
QCOMPARE(effect->numRepaints, 0);
|
QCOMPARE(effect->numRepaints, 0);
|
||||||
QCOMPARE(item->numRepaints, 1);
|
|
||||||
effect->reset();
|
effect->reset();
|
||||||
item->reset();
|
item->reset();
|
||||||
|
|
||||||
|
@ -1136,7 +1136,7 @@ void tst_QStyleSheetStyle::minmaxSizes()
|
|||||||
|
|
||||||
centerOnScreen(&tabWidget);
|
centerOnScreen(&tabWidget);
|
||||||
tabWidget.show();
|
tabWidget.show();
|
||||||
QTest::qWait(50);
|
QVERIFY(QTest::qWaitForWindowActive(&tabWidget));
|
||||||
//i allow 4px additional border from the native style (hence the -2, <=2)
|
//i allow 4px additional border from the native style (hence the -2, <=2)
|
||||||
QVERIFY(qAbs(page2->maximumSize().width() - 500 - 2) <= 2);
|
QVERIFY(qAbs(page2->maximumSize().width() - 500 - 2) <= 2);
|
||||||
QVERIFY(qAbs(page2->minimumSize().width() - 250 - 2) <= 2);
|
QVERIFY(qAbs(page2->minimumSize().width() - 250 - 2) <= 2);
|
||||||
@ -1165,7 +1165,7 @@ void tst_QStyleSheetStyle::task206238_twice()
|
|||||||
w.setStyleSheet("background: red;");
|
w.setStyleSheet("background: red;");
|
||||||
centerOnScreen(&w);
|
centerOnScreen(&w);
|
||||||
w.show();
|
w.show();
|
||||||
QTest::qWait(20);
|
QVERIFY(QTest::qWaitForWindowActive(&w));
|
||||||
QCOMPARE(BACKGROUND(w) , red);
|
QCOMPARE(BACKGROUND(w) , red);
|
||||||
QCOMPARE(BACKGROUND(*tw), red);
|
QCOMPARE(BACKGROUND(*tw), red);
|
||||||
w.setStyleSheet("background: red;");
|
w.setStyleSheet("background: red;");
|
||||||
@ -1366,8 +1366,7 @@ void tst_QStyleSheetStyle::proxyStyle()
|
|||||||
layout->addWidget(pb5);
|
layout->addWidget(pb5);
|
||||||
|
|
||||||
w->show();
|
w->show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(w));
|
||||||
QTest::qWait(100);
|
|
||||||
|
|
||||||
// Test for QTBUG-7198 - style sheet overrides custom element size
|
// Test for QTBUG-7198 - style sheet overrides custom element size
|
||||||
QStyleOptionViewItem opt;
|
QStyleOptionViewItem opt;
|
||||||
@ -1557,9 +1556,9 @@ void tst_QStyleSheetStyle::embeddedFonts()
|
|||||||
box.addItems(QStringList() << "First" << "Second" << "Third");
|
box.addItems(QStringList() << "First" << "Second" << "Third");
|
||||||
box.setStyleSheet("QComboBox { font-size: 32px; }");
|
box.setStyleSheet("QComboBox { font-size: 32px; }");
|
||||||
box.show();
|
box.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowActive(&box));
|
||||||
embedded = box.findChild<QLineEdit *>();
|
embedded = box.findChild<QLineEdit *>();
|
||||||
QVERIFY(embedded);
|
QVERIFY(embedded);
|
||||||
QTest::qWait(20);
|
|
||||||
QCOMPARE(box.font().pixelSize(), 32);
|
QCOMPARE(box.font().pixelSize(), 32);
|
||||||
QCOMPARE(embedded->font().pixelSize(), 32);
|
QCOMPARE(embedded->font().pixelSize(), 32);
|
||||||
}
|
}
|
||||||
@ -1652,7 +1651,7 @@ void tst_QStyleSheetStyle::task188195_baseBackground()
|
|||||||
tree.setStyleSheet( "QTreeView:disabled { background-color:#ab1251; }" );
|
tree.setStyleSheet( "QTreeView:disabled { background-color:#ab1251; }" );
|
||||||
tree.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(20, 100));
|
tree.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(20, 100));
|
||||||
tree.show();
|
tree.show();
|
||||||
QTest::qWait(20);
|
QVERIFY(QTest::qWaitForWindowActive(&tree));
|
||||||
QImage image(tree.width(), tree.height(), QImage::Format_ARGB32);
|
QImage image(tree.width(), tree.height(), QImage::Format_ARGB32);
|
||||||
|
|
||||||
tree.render(&image);
|
tree.render(&image);
|
||||||
@ -1673,7 +1672,7 @@ void tst_QStyleSheetStyle::task188195_baseBackground()
|
|||||||
table.setStyleSheet( "QTableView {background-color: #ff0000}" );
|
table.setStyleSheet( "QTableView {background-color: #ff0000}" );
|
||||||
table.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(300, 100));
|
table.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(300, 100));
|
||||||
table.show();
|
table.show();
|
||||||
QTest::qWait(20);
|
QVERIFY(QTest::qWaitForWindowActive(&table));
|
||||||
image = QImage(table.width(), table.height(), QImage::Format_ARGB32);
|
image = QImage(table.width(), table.height(), QImage::Format_ARGB32);
|
||||||
table.render(&image);
|
table.render(&image);
|
||||||
QVERIFY(testForColors(image, Qt::red, true));
|
QVERIFY(testForColors(image, Qt::red, true));
|
||||||
|
Loading…
Reference in New Issue
Block a user