diff --git a/examples/widget/widget.cpp b/examples/widget/widget.cpp index 0c84c60..8495ca7 100644 --- a/examples/widget/widget.cpp +++ b/examples/widget/widget.cpp @@ -43,7 +43,11 @@ Widget::~Widget() = default; void Widget::moveToDesktopCenter() { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) const QSize ss = screen()->size(); +#else + const QSize ss = QGuiApplication::primaryScreen()->size(); +#endif const int newX = (ss.width() - width()) / 2; const int newY = (ss.height() - height()) / 2; move(newX, newY);