aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-02 16:31:10 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-02 16:12:16 +0000
commit30143a9fd3aba11f7a8671f93987f7184c57bdb5 (patch)
tree16ca53946a5a0d66f2adc3e2311cd6eca5ab0977 /examples
parent2827dca2c076d03e8ea46be562e455bd286ad21a (diff)
opengl/contextinfo.py: Fix exception on exit
Stop the timer on hiding in exposeEvent(), fixing a warning about QOpenGLContext::makeCurrent() failing. Change-Id: Icaef927696e1c5ce6ea282a9ee3dfdb60968413a Fixes: PYSIDE-865 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/opengl/contextinfo.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/opengl/contextinfo.py b/examples/opengl/contextinfo.py
index f0ea345e..bb747fa9 100644
--- a/examples/opengl/contextinfo.py
+++ b/examples/opengl/contextinfo.py
@@ -173,7 +173,11 @@ class RenderWindow(QWindow):
if self.timer is None:
self.timer = QTimer(self)
self.timer.timeout.connect(self.slotTimer)
+ if not self.timer.isActive():
self.timer.start(10)
+ else:
+ if self.timer and self.timer.isActive():
+ self.timer.stop()
def render(self):
if not self.context.makeCurrent(self):