Replace deprecated parts of the code (#2419)

Performing a dev build against the latest version of Qt failed
because of some deprecated members. They have been replaced
according to the Qt documentation.

Further, Q_OS_MACOS is now the only macro available to identify a
machine running macOS, the others are now deprecated.
See https://doc.qt.io/qt-5/qtglobal.html#Q_OS_OSX and
https://doc.qt.io/qt-5/qtglobal.html#Q_OS_MAC.
This commit is contained in:
Gianluca Recchia
2018-10-26 15:19:04 +02:00
committed by Janek Bevendorff
parent efdb43dc53
commit f31d65bdaf
26 changed files with 57 additions and 47 deletions

View File

@@ -19,7 +19,11 @@
#include "AutoTypeSelectDialog.h"
#include <QApplication>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#include <QScreen>
#else
#include <QDesktopWidget>
#endif
#include <QDialogButtonBox>
#include <QHeaderView>
#include <QLabel>
@@ -44,7 +48,11 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
setWindowTitle(tr("Auto-Type - KeePassXC"));
setWindowIcon(filePath()->applicationIcon());
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QRect screenGeometry = QApplication::screenAt(QCursor::pos())->availableGeometry();
#else
QRect screenGeometry = QApplication::desktop()->availableGeometry(QCursor::pos());
#endif
QSize size = config()->get("GUI/AutoTypeSelectDialogSize", QSize(600, 250)).toSize();
size.setWidth(qMin(size.width(), screenGeometry.width()));
size.setHeight(qMin(size.height(), screenGeometry.height()));