diff options
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.cpp')
-rw-r--r-- | examples/opengl/hellowindow/hellowindow.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index 489d715166..380ddcc702 100644 --- a/examples/opengl/hellowindow/hellowindow.cpp +++ b/examples/opengl/hellowindow/hellowindow.cpp @@ -72,16 +72,21 @@ HelloWindow::HelloWindow(Renderer *renderer) create(); - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(render())); - timer->start(10); - connect(this, SIGNAL(needRender(QSurface *, const QColor &, const QSize &)), renderer, SLOT(render(QSurface *, const QColor &, const QSize &))); updateColor(); } +void HelloWindow::exposeEvent(QExposeEvent *event) +{ + render(); + + QTimer *timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(render())); + timer->start(10); +} + void HelloWindow::mousePressEvent(QMouseEvent *) { updateColor(); |