From 506ccf3dd651b23f3d98eac4d2cb396047fe2015 Mon Sep 17 00:00:00 2001 From: Artem Proskurnev Date: Fri, 2 Jul 2021 00:59:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=20Win=20=D0=BD=D0=B5=20=D0=BD=D0=B0?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B8=D1=82=D1=81=D1=8F=20QDesktopWidget.=20?= =?UTF-8?q?=D0=92=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE,=20=D0=BE?= =?UTF-8?q?=D0=BD=20"is=20deprecated"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qtsgraph.cpp | 4 ++-- qtsgraph.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qtsgraph.cpp b/qtsgraph.cpp index e45ae2b..29279ad 100644 --- a/qtsgraph.cpp +++ b/qtsgraph.cpp @@ -69,8 +69,8 @@ QTSGraph::QTSGraph(int w, int h, int x, int y, QWidget *parent) { if(x < 0 || y < 0) { - QDesktopWidget desktop; - QRect rect = desktop.availableGeometry(desktop.primaryScreen()); // прямоугольник с размерами экрана + QScreen *scr = QGuiApplication::screens().at(0); //получаем ссылку на основной экран + QRect rect = scr->availableGeometry(); //прямоугольник с размерами экрана QPoint center = rect.center(); //координаты центра экрана x = center.x() - w / 2; y = center.y() - h / 2; diff --git a/qtsgraph.h b/qtsgraph.h index d10b52e..4810d33 100644 --- a/qtsgraph.h +++ b/qtsgraph.h @@ -39,7 +39,7 @@ along with Vesi. If not, see . #include #include #include -#include +#include #include #include #include