From b468122ce55236e4445eae72b610b0cd575f8164 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 4 Aug 2011 10:36:14 -0400 Subject: [PATCH] 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 --- pqEventDispatcher.cxx | 1 + pqEventDispatcher.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pqEventDispatcher.cxx b/pqEventDispatcher.cxx index 378a739..7849028 100644 --- a/pqEventDispatcher.cxx +++ b/pqEventDispatcher.cxx @@ -257,6 +257,7 @@ void pqEventDispatcher::processEventsAndWait(int ms) pqEventDispatcher::DeferMenuTimeouts = true; if (ms > 0) { + ms = (ms < 100) ? 100 : ms; QApplication::processEvents(); QEventLoop loop; QTimer::singleShot(ms, &loop, SLOT(quit())); diff --git a/pqEventDispatcher.h b/pqEventDispatcher.h index 1cc7590..a3b6658 100644 --- a/pqEventDispatcher.h +++ b/pqEventDispatcher.h @@ -62,7 +62,9 @@ public: bool playEvents(pqEventSource& source, pqEventPlayer& player); /** 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); /** proccessEvents method for widgets and paraview to use instead of -- GitLab