summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp5
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp11
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 210e52f0aa..3fa669c1fb 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -3902,6 +3902,11 @@ void tst_QLineEdit::inputMethod()
// removing focus allows input method to commit preedit
testWidget->setText("");
testWidget->activateWindow();
+ // TODO setFocus should not be necessary here, because activateWindow
+ // should focus it, and the window is the QLineEdit. But the test can fail
+ // on Windows if we don't do this. If each test had a unique QLineEdit
+ // instance, maybe such problems would go away.
+ testWidget->setFocus();
QTRY_VERIFY(testWidget->hasFocus());
QTRY_COMPARE(qApp->focusObject(), testWidget);
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index 2bbfb48e63..e373e50e0a 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -115,7 +115,9 @@ void tst_QProgressBar::minMaxSameValue()
QProgressBar bar;
bar.setRange(10, 10);
bar.setValue(10);
+ bar.move(300, 300);
bar.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&bar));
}
void tst_QProgressBar::destroyIndeterminate()
@@ -125,7 +127,9 @@ void tst_QProgressBar::destroyIndeterminate()
// it's deleted.
QPointer<QProgressBar> bar = new QProgressBar;
bar->setMaximum(0);
+ bar->move(300, 300);
bar->show();
+ QVERIFY(QTest::qWaitForWindowExposed(bar.data()));
QEventLoop loop;
QTimer::singleShot(500, bar, SLOT(deleteLater()));
@@ -168,8 +172,10 @@ void tst_QProgressBar::format()
ProgressBar bar;
bar.setRange(0, 10);
bar.setValue(1);
+ bar.move(300, 300);
bar.show();
QVERIFY(QTest::qWaitForWindowExposed(&bar));
+ QVERIFY(QTest::qWaitForWindowExposed(&bar));
QTest::qWait(20);
bar.repainted = false;
@@ -204,6 +210,7 @@ void tst_QProgressBar::setValueRepaint()
pbar.setMinimum(0);
pbar.setMaximum(10);
pbar.setFormat("%v");
+ pbar.move(300, 300);
pbar.show();
QVERIFY(QTest::qWaitForWindowExposed(&pbar));
@@ -226,7 +233,9 @@ void tst_QProgressBar::setMinMaxRepaint()
pbar.setMinimum(0);
pbar.setMaximum(10);
pbar.setFormat("%v");
+ pbar.move(300, 300);
pbar.show();
+ qApp->setActiveWindow(&pbar);
QVERIFY(QTest::qWaitForWindowActive(&pbar));
// No repaint when setting minimum to the current minimum
@@ -355,7 +364,9 @@ void tst_QProgressBar::task245201_testChangeStyleAndDelete()
QStyle *style = QStyleFactory::create(style1_str);
bar->setStyle(style);
+ bar->move(300, 300);
bar->show();
+ QVERIFY(QTest::qWaitForWindowExposed(bar));
QStyle *style2 = QStyleFactory::create(style2_str);
bar->setStyle(style2);
QTest::qWait(10);