diff options
Diffstat (limited to 'examples/opengl/hellogl2/window.cpp')
-rw-r--r-- | examples/opengl/hellogl2/window.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/opengl/hellogl2/window.cpp b/examples/opengl/hellogl2/window.cpp index 169f5e59c5..59570c83ca 100644 --- a/examples/opengl/hellogl2/window.cpp +++ b/examples/opengl/hellogl2/window.cpp @@ -122,8 +122,8 @@ void Window::dockUndock() if (parent()) { setParent(nullptr); setAttribute(Qt::WA_DeleteOnClose); - move(QApplication::desktop()->width() / 2 - width() / 2, - QApplication::desktop()->height() / 2 - height() / 2); + move(QGuiApplication::primaryScreen()->size().width() / 2 - width() / 2, + QGuiApplication::primaryScreen()->size().height() / 2 - height() / 2); dockBtn->setText(tr("Dock")); show(); } else { |