diff options
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.cpp')
-rw-r--r-- | examples/opengl/hellowindow/hellowindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index 6de48e8c95..b0576c1255 100644 --- a/examples/opengl/hellowindow/hellowindow.cpp +++ b/examples/opengl/hellowindow/hellowindow.cpp @@ -34,6 +34,13 @@ void HelloWindow::mousePressEvent(QMouseEvent *) updateColor(); } +void HelloWindow::resizeEvent(QResizeEvent *) +{ + glContext()->makeCurrent(); + + glViewport(0, 0, geometry().width(), geometry().height()); +} + void HelloWindow::updateColor() { float colors[][4] = |