diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-09-19 19:12:10 +0200 |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-09-21 10:07:39 +0200 |
commit | 6248dff2c7f3288d675de639abfbbc6c1d618006 (patch) | |
tree | 11c8a736b8b2b3a8fd474225cab630370f369d57 /src/gui/itemviews/qabstractitemview.cpp | |
parent | 789303e0f80a299eb3cfacc1d84dbdc1d3e4abeb (diff) |
Give the soft key functionality it's own macro.
Re-using QT_KEYPAD_NAVIGATION for soft keys is wrong since the two
are independant concepts. This puts everything in a new macro called
QT_SOFTKEYS_ENABLED. This will also insulate the embedded customers
who use keypad navigation from the soft key changes.
Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 8eb5425c89..715f92d907 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -88,7 +88,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() overwrite(false), dropIndicatorPosition(QAbstractItemView::OnItem), #endif -#ifdef QT_KEYPAD_NAVIGATION +#ifdef QT_SOFTKEYS_ENABLED doneSoftKey(0), #endif autoScroll(true), @@ -132,7 +132,7 @@ void QAbstractItemViewPrivate::init() q->setAttribute(Qt::WA_InputMethodEnabled); -#ifdef QT_KEYPAD_NAVIGATION +#ifdef QT_SOFTKEYS_ENABLED doneSoftKey = QSoftKeyManager::createKeyedAction(QAction::EndEditSoftKey, Qt::Key_Back, q); #endif } @@ -2071,14 +2071,18 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); +#ifdef QT_SOFTKEYS_ENABLED addAction(d->doneSoftKey); +#endif return; } } break; case Qt::Key_Back: if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { +#ifdef QT_SOFTKEYS_ENABLED removeAction(d->doneSoftKey); +#endif setEditFocus(false); } else { event->ignore(); |