Qt: Avoid setting fixed window size

set minimum and maximum sizes to the same value instead
This commit is contained in:
Alexander Babikov
2025-08-17 04:23:55 +05:00
parent d7aee604c4
commit 43877ae7d5
5 changed files with 19 additions and 4 deletions

View File

@@ -31,7 +31,6 @@ UpdateCheckDialog(const UpdateCheck::UpdateChannel channel, QWidget *parent) : Q
{
ui->setupUi(this);
ui->statusLabel->setHidden(true);
this->setFixedSize(400, 130);
updateChannel = channel;
currentVersion = UpdateCheck::getCurrentVersion(updateChannel);
connect(updateCheck, &UpdateCheck::updateCheckError, [=](const QString &errorMsg) {

View File

@@ -10,6 +10,18 @@
<height>130</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>130</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>400</width>
<height>130</height>
</size>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>

View File

@@ -58,7 +58,9 @@ VMManagerAddMachine(QWidget *parent) : QWizard(parent)
#endif
// Wizard wants to resize based on image. This keeps the size
setFixedSize(QSize(550, size().height()));
setMinimumSize(QSize(550, size().height()));
setMaximumSize(QSize(550, size().height()));
setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true);
setOption(HaveHelpButton, false);
// setPixmap(LogoPixmap, QPixmap(":/settings/qt/icons/86Box-gray.ico"));

View File

@@ -238,7 +238,8 @@ illegal_chars:
progDialog->setMaximum(0);
progDialog->setMinimum(0);
progDialog->setWindowFlags(progDialog->windowFlags() & ~Qt::WindowCloseButtonHint);
progDialog->setFixedSize(progDialog->sizeHint());
progDialog->setMinimumSize(progDialog->sizeHint());
progDialog->setMaximumSize(progDialog->sizeHint());
progDialog->setMinimumDuration(0);
progDialog->setCancelButton(nullptr);
progDialog->setAutoClose(false);

View File

@@ -132,7 +132,8 @@ VMManagerSystem::scanForConfigs(QWidget* parent, const QString &searchPath)
progDialog.setMinimum(0);
progDialog.setMaximum(0);
progDialog.setWindowFlags(progDialog.windowFlags() & ~Qt::WindowCloseButtonHint);
progDialog.setFixedSize(progDialog.sizeHint());
progDialog.setMinimumSize(progDialog.sizeHint());
progDialog.setMaximumSize(progDialog.sizeHint());
QElapsedTimer scanTimer;
scanTimer.start();
QVector<VMManagerSystem *> system_configs;