Commit 50c49129 authored by Robert Maynard's avatar Robert Maynard

Add processEvents method to testing framework.

Because you can't use Qt processEvents method and have tests play properly we need a proper replacement.
parent 12f1f3b4
......@@ -261,3 +261,12 @@ void pqEventDispatcher::processEventsAndWait(int ms)
QApplication::processEvents();
pqEventDispatcher::DeferMenuTimeouts = prev;
}
//-----------------------------------------------------------------------------
void pqEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
{
bool prev = pqEventDispatcher::DeferMenuTimeouts;
pqEventDispatcher::DeferMenuTimeouts = true;
QApplication::processEvents(flags);
pqEventDispatcher::DeferMenuTimeouts = prev;
}
......@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QObject>
#include <QTimer>
#include <QTime>
#include <QEventLoop>
class pqEventPlayer;
class pqEventSource;
......@@ -64,6 +65,10 @@ public:
to perform a certain action */
static void processEventsAndWait(int ms);
/** proccessEvents method for widgets and paraview to use instead of
calling Qt version, since that will break test playback*/
static void processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents);
protected slots:
/// Plays a single event. this->PlayBackFinished and this->PlayBackStatus are
/// updated by this method.
......
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