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