diff options
author | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-16 07:44:07 (GMT) |
---|---|---|
committer | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-16 07:44:07 (GMT) |
commit | df299de9748adb2cdb21834956907076971ff45d (patch) | |
tree | 8ba97f5f5e343cc2959f854547d5ebc74fde93b2 /examples/widgets | |
parent | 52c5ea949df2e635418a5542146d469fde8416a5 (diff) | |
download | Qt-df299de9748adb2cdb21834956907076971ff45d.zip Qt-df299de9748adb2cdb21834956907076971ff45d.tar.gz Qt-df299de9748adb2cdb21834956907076971ff45d.tar.bz2 |
Bugfix. Softkeys were set to wrong widget when combobox was
focused.
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/softkeys/softkeys.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index 9672aee..e717510 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -127,7 +127,9 @@ void MainWindow::addSoftKeys() QList<QAction*> softkeys; softkeys.append(ok); softkeys.append(cancel); - pushButton->setSoftKeys(softkeys); + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) + focusWidget->setSoftKeys(softkeys); } void MainWindow::exitApplication() @@ -138,13 +140,17 @@ void MainWindow::exitApplication() void MainWindow::okPressed() { infoLabel->setText(tr("OK pressed")); - pushButton->setSoftKey(0); + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) + focusWidget->setSoftKey(0); } void MainWindow::cancelPressed() { infoLabel->setText(tr("Cancel pressed")); - pushButton->setSoftKey(0); + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) + focusWidget->setSoftKey(0); } |