summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/auto/widgets/util.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/widgets/util.h b/tests/auto/widgets/util.h
index 20241be8b..ca03c5833 100644
--- a/tests/auto/widgets/util.h
+++ b/tests/auto/widgets/util.h
@@ -83,10 +83,13 @@ public:
QObject::connect(&timeoutTimer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
}
- T waitForResult() {
- if (!called) {
- timeoutTimer.start(20000);
+ T waitForResult(int timeout = 20000) {
+ const int step = 1000;
+ int elapsed = 0;
+ while (elapsed < timeout && !called) {
+ timeoutTimer.start(step);
eventLoop.exec();
+ elapsed += step;
}
return result;
}