From e4bdc17112782e0587d9349123393eb594cde872 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 22 Feb 2016 23:11:29 -0800 Subject: [PATCH] Add qWait surrogate for PySide --- pyqtgraph/Qt.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py index 3584bec0..c9700784 100644 --- a/pyqtgraph/Qt.py +++ b/pyqtgraph/Qt.py @@ -9,7 +9,7 @@ This module exists to smooth out some of the differences between PySide and PyQt """ -import sys, re +import sys, re, time from .python2_3 import asUnicode @@ -45,6 +45,15 @@ if QT_LIB == PYSIDE: from PySide import QtGui, QtCore, QtOpenGL, QtSvg try: from PySide import QtTest + if not hasattr(QtTest.QTest, 'qWait'): + @staticmethod + def qWait(msec): + start = time.time() + QtGui.QApplication.processEvents() + while time.time() < start + msec * 0.001: + QtGui.QApplication.processEvents() + QtTest.QTest.qWait = qWait + except ImportError: pass import PySide