From b68d0688feb7b01eca91b33566887200de7fc89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 28 Apr 2011 13:50:07 +0200 Subject: Add resize event support to QWindow. (cherry picked from commit 12b4e7e5a2b18cdd23f540821e1f2785f62b0b9a) --- examples/opengl/hellowindow/hellowindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'examples/opengl/hellowindow/hellowindow.cpp') diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp index 6de48e8c951..b0576c1255d 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] = -- cgit v1.2.3