From 689b101c55976db9a02c9b121cc35fcfca3f3dc0 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:29:47 +0100 Subject: [PATCH] better solution for maximum config-dialog-size --- sources/configdialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sources/configdialog.cpp b/sources/configdialog.cpp index 99442496a..04457dc2b 100644 --- a/sources/configdialog.cpp +++ b/sources/configdialog.cpp @@ -79,8 +79,16 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) { connect(pages_list, SIGNAL(currentRowChanged(int)), pages_widget, SLOT(setCurrentIndex(int))); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + // set maximum a bit smaller than available size = (screen-size - Task-Bar): + // "primaryScreen" <-> the screen where the main widget of application resides + setMaximumSize((int)(0.95 * QGuiApplication::primaryScreen()->availableSize().width()), + (int)(0.95 * QGuiApplication::primaryScreen()->availableSize().height())); +#else + // set maximum smaller than screen-size setMaximumSize((int)(0.85 * MachineInfo::instance()->i_max_screen_width()), (int)(0.85 * MachineInfo::instance()->i_max_screen_height())); +#endif resize(std::min(1400,maximumWidth()), std::min(1000,maximumHeight()));