fix for Qt < 5.14

This commit is contained in:
jkriege2 2022-04-22 20:53:54 +02:00
parent 014f4e597f
commit b8f1ac7edb

View File

@ -25,7 +25,7 @@
#include <QApplication> #include <QApplication>
#include <QLocale> #include <QLocale>
#include <QtCore> #include <QtCore>
#if (QT_VERSION>QT_VERSION_CHECK(5, 3, 0)) #if (QT_VERSION>QT_VERSION_CHECK(5, 14, 0))
# include <QScreen> # include <QScreen>
# include <QGuiApplication> # include <QGuiApplication>
#else #else
@ -43,7 +43,7 @@ void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& p
void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix) { void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix) {
QPoint pos = settings.value(prefix+"pos", defaultPosition).toPoint(); QPoint pos = settings.value(prefix+"pos", defaultPosition).toPoint();
const QSize size = settings.value(prefix+"size", defaultSize).toSize(); const QSize size = settings.value(prefix+"size", defaultSize).toSize();
#if (QT_VERSION>=QT_VERSION_CHECK(5, 3, 0)) #if (QT_VERSION>=QT_VERSION_CHECK(5, 14, 0))
const auto widgeo = widget->screen()->geometry(); const auto widgeo = widget->screen()->geometry();
#else #else
const auto widgeo = QApplication::desktop()->screenGeometry(widget); const auto widgeo = QApplication::desktop()->screenGeometry(widget);