summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qcombobox.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-06-01 17:06:04 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-06-01 17:06:04 (GMT)
commit988f6ae93c771fe94f12a0307d34c14edd5f2c3b (patch)
tree57650fed6c491d635399504d674e33956cfbf15f /src/gui/widgets/qcombobox.cpp
parent19f36cfed2c64160c17d0b8a6ed8a3b90dbf0d4b (diff)
downloadQt-988f6ae93c771fe94f12a0307d34c14edd5f2c3b.zip
Qt-988f6ae93c771fe94f12a0307d34c14edd5f2c3b.tar.gz
Qt-988f6ae93c771fe94f12a0307d34c14edd5f2c3b.tar.bz2
Using softkeys for the Cancel/Back buttons during keypad navigation
Diffstat (limited to 'src/gui/widgets/qcombobox.cpp')
-rw-r--r--src/gui/widgets/qcombobox.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 16e2f39..59b740f 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -75,6 +75,9 @@
#ifndef QT_NO_EFFECTS
# include <private/qeffects_p.h>
#endif
+#ifdef QT_KEYPAD_NAVIGATION
+# include <private/qsoftkeystack_p.h>
+#endif
QT_BEGIN_NAMESPACE
extern QHash<QByteArray, QFont> *qt_app_fonts_hash();
@@ -628,6 +631,9 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Select:
#endif
if (view->currentIndex().isValid() && (view->currentIndex().flags() & Qt::ItemIsEnabled) ) {
+#ifdef QT_KEYPAD_NAVIGATION
+ QKeyEventSoftKey::removeSoftkey(this);
+#endif
combo->hidePopup();
emit itemSelected(view->currentIndex());
}
@@ -640,7 +646,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Escape:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
- case Qt::Key_Context2: // TODO: aportale, KEYPAD_NAVIGATION_HACK when softkey support is there
+ QKeyEventSoftKey::removeSoftkey(this);
#endif
combo->hidePopup();
return true;
@@ -2435,6 +2441,7 @@ void QComboBox::showPopup()
#ifdef QT_KEYPAD_NAVIGATION
if (QApplication::keypadNavigationEnabled())
view()->setEditFocus(true);
+ QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, this);
#endif
}