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>
bb10
Tor Arne Vestbø 2018-11-16 15:06:18 +01:00 committed by Liang Qi
parent 12045801f7
commit 666f3b4a78
1 changed files with 2 additions and 1 deletions

View File

@ -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);