Reduce build warnings and enable Qt build

This commit is contained in:
root
2026-04-28 16:50:31 +00:00
parent 34864c5254
commit 43b88c7110
43 changed files with 164 additions and 87 deletions
+7
View File
@@ -52,7 +52,9 @@
#include <QDoubleValidator>
#include <QFileDialog>
#include <QFont>
#include <QGuiApplication>
#include <QLineEdit>
#include <QScreen>
#include <QSettings>
#include <QTextDocument> // for Qt::mightBeRichText
#include <QThread>
@@ -787,7 +789,12 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,
QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
if (!pos.x() && !pos.y()) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QScreen* screenHandle = QGuiApplication::primaryScreen();
QRect screen = screenHandle ? screenHandle->geometry() : QRect(QPoint(), size);
#else
QRect screen = QApplication::desktop()->screenGeometry();
#endif
pos.setX((screen.width() - size.width()) / 2);
pos.setY((screen.height() - size.height()) / 2);
}