Commit 5449e0a7 authored by Daniel Teske's avatar Daniel Teske

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: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 0d9b2548
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment