Class QDesktopWidget is obsolete.

Missed two more usages.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-05-27 12:08:02 +03:00
parent 71e1cc33c0
commit 4109848349
2 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>
#include <QDesktopWidget> #include <QScreen>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPieceName, QWidget *parent) DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPieceName, QWidget *parent)
@ -49,7 +49,7 @@ DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPiece
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c()); qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());
QRect position = this->frameGeometry(); QRect position = this->frameGeometry();
position.moveCenter(QDesktopWidget().availableGeometry().center()); position.moveCenter(QGuiApplication::primaryScreen()->availableGeometry().center());
move(position.topLeft()); move(position.topLeft());
ui->lineEditName->setText(patternPieceName); ui->lineEditName->setText(patternPieceName);

View File

@ -28,8 +28,9 @@
#include "vwidgetpopup.h" #include "vwidgetpopup.h"
#include <QDesktopWidget> #include <QScreen>
#include <QFont> #include <QFont>
#include <QGuiApplication>
#include <QLabel> #include <QLabel>
#include <QLayout> #include <QLayout>
#include <QMessageLogger> #include <QMessageLogger>
@ -109,7 +110,7 @@ void VWidgetPopup::Show(QPoint coord)
// important to do this before following adjustments! // important to do this before following adjustments!
QFrame::show(); QFrame::show();
const QRect screen(QDesktopWidget().availableGeometry()); const QRect screen(QGuiApplication::primaryScreen()->availableGeometry());
coord.setX(coord.x() - width()/2); coord.setX(coord.x() - width()/2);
if (coord.x() < screen.x()) if (coord.x() < screen.x())