summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellowindow
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2016-08-23 08:02:16 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-06-27 23:51:15 +0000
commit24961cb18c50efab4b62b91968f660d8b6736ec4 (patch)
treef05be283c1f3b81b3d8ae11a3dc720904ac6b0cf /examples/opengl/hellowindow
parent6ca65dd97d252d1618dd9870bf119b2d482e7eaf (diff)
Don’t flicker on startup: render on expose
All QWindow implementations must produce a frame before returning from the expose event. Change-Id: I5640809c47e948101879c1623c12230fa0a63c44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'examples/opengl/hellowindow')
-rw-r--r--examples/opengl/hellowindow/hellowindow.cpp2
-rw-r--r--examples/opengl/hellowindow/hellowindow.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp
index 235775f09a..048190d766 100644
--- a/examples/opengl/hellowindow/hellowindow.cpp
+++ b/examples/opengl/hellowindow/hellowindow.cpp
@@ -93,6 +93,8 @@ HelloWindow::HelloWindow(const QSharedPointer<Renderer> &renderer, QScreen *scre
void HelloWindow::exposeEvent(QExposeEvent *)
{
m_renderer->setAnimating(this, isExposed());
+ if (isExposed())
+ m_renderer->render();
}
void HelloWindow::mousePressEvent(QMouseEvent *)
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
index 1372152e93..e92e45a125 100644
--- a/examples/opengl/hellowindow/hellowindow.h
+++ b/examples/opengl/hellowindow/hellowindow.h
@@ -70,7 +70,7 @@ public:
void setAnimating(HelloWindow *window, bool animating);
-private slots:
+public slots:
void render();
private: