Adjust the bottom buttons layout

This commit fixes an issue where the bottom buttons of
'PreferencesDialog' are positioned erratically on non-macOS platforms.
For further information, refer to 'Need Help' section of #2394 PR.
This commit is contained in:
SeongTae Jeong
2020-10-01 21:44:39 +09:00
parent 47b61d25c1
commit b5a0d531cb
2 changed files with 29 additions and 13 deletions

View File

@@ -50,11 +50,9 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Tabs tab)
// Set current tab
ui->tabWidget->setCurrentIndex(tab);
// Add 'Export Settings' and 'Import Settings' buttons
const QPushButton* exportSettings = ui->buttonBox->addButton(tr("Export Settings"), QDialogButtonBox::ActionRole);
connect(exportSettings, &QPushButton::clicked, this, &PreferencesDialog::exportSettings);
const QPushButton* importSettings = ui->buttonBox->addButton(tr("Import Settings"), QDialogButtonBox::ActionRole);
connect(importSettings, &QPushButton::clicked, this, &PreferencesDialog::importSettings);
// Connect 'Export Settings' and 'Import Settings' buttons
connect(ui->buttonExportSettings, &QPushButton::clicked, this, &PreferencesDialog::exportSettings);
connect(ui->buttonImportSettings, &QPushButton::clicked, this, &PreferencesDialog::importSettings);
}
/*

View File

@@ -1934,14 +1934,32 @@ Can be set to 0 for disabling completion.</string>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults|QDialogButtonBox::Save</set>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_bottomButtons">
<item>
<widget class="QPushButton" name="buttonExportSettings">
<property name="text">
<string>Export Settings</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonImportSettings">
<property name="text">
<string>Import Settings</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults|QDialogButtonBox::Save</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>