From 24961cb18c50efab4b62b91968f660d8b6736ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 23 Aug 2016 08:02:16 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20flicker=20on=20startup:=20rende?= =?UTF-8?q?r=20on=20expose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All QWindow implementations must produce a frame before returning from the expose event. Change-Id: I5640809c47e948101879c1623c12230fa0a63c44 Reviewed-by: Tor Arne Vestbø --- examples/opengl/hellowindow/hellowindow.cpp | 2 ++ examples/opengl/hellowindow/hellowindow.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index 235775f09a8..048190d7666 100644 --- a/examples/opengl/hellowindow/hellowindow.cpp +++ b/examples/opengl/hellowindow/hellowindow.cpp @@ -93,6 +93,8 @@ HelloWindow::HelloWindow(const QSharedPointer &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 1372152e936..e92e45a125d 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: