summaryrefslogtreecommitdiffstats
path: root/examples/gui/openglwindow/openglwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-11-16 15:06:18 +0100
committerLiang Qi <liang.qi@qt.io>2018-11-20 19:51:12 +0000
commit666f3b4a7819d67f745f4497ef5191521ed8c33b (patch)
tree4e5b9ca91cd26b0b25820bd62337f48ca428e5fa /examples/gui/openglwindow/openglwindow.cpp
parent12045801f742dd956f17d1a6c72b21f8f245a671 (diff)
Take device-pixel-ratio into account in openglwindow example
Also affects the windowcontainer example, which includes an OpenGL window. Change-Id: Ic9f0f2aa66410b657e08c0225b085dd8df44e2a7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/gui/openglwindow/openglwindow.cpp')
-rw-r--r--examples/gui/openglwindow/openglwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/gui/openglwindow/openglwindow.cpp b/examples/gui/openglwindow/openglwindow.cpp
index 57a996a876..a0c85006bd 100644
--- a/examples/gui/openglwindow/openglwindow.cpp
+++ b/examples/gui/openglwindow/openglwindow.cpp
@@ -88,7 +88,8 @@ void OpenGLWindow::render()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- m_device->setSize(size());
+ m_device->setSize(size() * devicePixelRatio());
+ m_device->setDevicePixelRatio(devicePixelRatio());
QPainter painter(m_device);
render(&painter);