aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@theqtcompany.com>2014-11-21 17:49:05 +0100
committerDaniel Teske <daniel.teske@theqtcompany.com>2014-11-24 11:48:42 +0100
commit5449e0a731dce1ff313c213ffe592c45b1d952d7 (patch)
tree7105f859e862299324d59143d934fab3242a60eb
parent0d9b2548400897a4c64d5955d51fa6a244f01701 (diff)
SettingsDialog: Fix default button
The default button would move to the first pushbutton that got focus. E.g. tabbing through the android settings would move the default button to the first button that got focus. The cause of that is that for QPushButton::setDefault to work, the button needs to be a child of the QDialog. So call it after adding the buttongroup to the layout. Change-Id: Ife35bf15aa8585f7931a87ee715f316bb02b36be Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/plugins/coreplugin/dialogs/settingsdialog.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
index 6aaed1a092..22975a9f3e 100644
--- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
@@ -412,7 +412,6 @@ void SettingsDialog::createGui()
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Apply |
QDialogButtonBox::Cancel);
- buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
@@ -425,6 +424,9 @@ void SettingsDialog::createGui()
mainGridLayout->addWidget(buttonBox, 2, 0, 1, 2);
mainGridLayout->setColumnStretch(1, 4);
setLayout(mainGridLayout);
+
+ buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
+
setMinimumSize(1000, 550);
if (Utils::HostOsInfo::isMacHost())
setMinimumHeight(minimumHeight() * 1.1);