Commit b468122c authored by Robert Maynard's avatar Robert Maynard

BUG: Fixed a subtle bug on slow machines that caused tests to hang.

The timer calling quit on the event loop would be called before the exec happend
parent 943b05de
...@@ -257,6 +257,7 @@ void pqEventDispatcher::processEventsAndWait(int ms) ...@@ -257,6 +257,7 @@ void pqEventDispatcher::processEventsAndWait(int ms)
pqEventDispatcher::DeferMenuTimeouts = true; pqEventDispatcher::DeferMenuTimeouts = true;
if (ms > 0) if (ms > 0)
{ {
ms = (ms < 100) ? 100 : ms;
QApplication::processEvents(); QApplication::processEvents();
QEventLoop loop; QEventLoop loop;
QTimer::singleShot(ms, &loop, SLOT(quit())); QTimer::singleShot(ms, &loop, SLOT(quit()));
......
...@@ -62,7 +62,9 @@ public: ...@@ -62,7 +62,9 @@ public:
bool playEvents(pqEventSource& source, pqEventPlayer& player); bool playEvents(pqEventSource& source, pqEventPlayer& player);
/** Wait function provided for players that need to wait for the GUI /** Wait function provided for players that need to wait for the GUI
to perform a certain action */ to perform a certain action.
Note: the minimum wait time is 100ms. This is set to avoid timiing issues
on slow processors that hang tests.*/
static void processEventsAndWait(int ms); static void processEventsAndWait(int ms);
/** proccessEvents method for widgets and paraview to use instead of /** proccessEvents method for widgets and paraview to use instead of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment