summaryrefslogtreecommitdiffstats
path: root/tests/auto/q3progressbar/tst_q3progressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/q3progressbar/tst_q3progressbar.cpp')
-rw-r--r--tests/auto/q3progressbar/tst_q3progressbar.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/q3progressbar/tst_q3progressbar.cpp b/tests/auto/q3progressbar/tst_q3progressbar.cpp
index 745e2d5..3a0c3e2 100644
--- a/tests/auto/q3progressbar/tst_q3progressbar.cpp
+++ b/tests/auto/q3progressbar/tst_q3progressbar.cpp
@@ -45,6 +45,7 @@
#include <qapplication.h>
#include <qdebug.h>
#include <q3progressbar.h>
+#include "../../shared/util.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -106,7 +107,7 @@ void tst_Q3ProgressBar::setProgress()
{
MyCustomProgressBar * m_progressBar = new MyCustomProgressBar();
m_progressBar->show();
- QApplication::processEvents();
+ QTest::qWaitForWindowShown(m_progressBar);
//case with total steps = 0
m_progressBar->setTotalSteps(0);
@@ -114,10 +115,9 @@ void tst_Q3ProgressBar::setProgress()
m_progressBar->paintNumber = 0;
m_progressBar->setProgress(m_progressBar->progress() + 1);
QCOMPARE(oldValue + 1,m_progressBar->progress());
- QApplication::processEvents();
// It might be > 1 because it is animated.
- QVERIFY(m_progressBar->paintNumber >= 1);
+ QTRY_VERIFY(m_progressBar->paintNumber >= 1);
qDebug() << "Animation test: paintNumber =" << m_progressBar->paintNumber;
//standard case
@@ -125,10 +125,9 @@ void tst_Q3ProgressBar::setProgress()
m_progressBar->setProgress(0);
m_progressBar->paintNumber = 0;
m_progressBar->setProgress(m_progressBar->progress() + 1);
- QApplication::processEvents();
// It might be > 1 because other events might cause painting.
- QVERIFY(m_progressBar->paintNumber >= 1);
+ QTRY_VERIFY(m_progressBar->paintNumber >= 1);
qDebug() << "Standard test: paintNumber =" << m_progressBar->paintNumber;
}