summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-16 07:44:07 (GMT)
committerMarkku Luukkainen <markku.luukkainen@digia.com>2009-06-16 07:44:07 (GMT)
commitdf299de9748adb2cdb21834956907076971ff45d (patch)
tree8ba97f5f5e343cc2959f854547d5ebc74fde93b2
parent52c5ea949df2e635418a5542146d469fde8416a5 (diff)
downloadQt-df299de9748adb2cdb21834956907076971ff45d.zip
Qt-df299de9748adb2cdb21834956907076971ff45d.tar.gz
Qt-df299de9748adb2cdb21834956907076971ff45d.tar.bz2
Bugfix. Softkeys were set to wrong widget when combobox was
focused.
-rw-r--r--examples/widgets/softkeys/softkeys.cpp12
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);
}