diff options
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 13 | ||||
-rw-r--r-- | src/gui/itemviews/qabstractitemview_p.h | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 5c68928..8eb5425 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,7 +61,7 @@ #ifndef QT_NO_ACCESSIBILITY #include <qaccessible.h> #endif -#include <private/qactiontokeyeventmapper_p.h> +#include <private/qsoftkeymanager_p.h> QT_BEGIN_NAMESPACE @@ -88,6 +88,9 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() overwrite(false), dropIndicatorPosition(QAbstractItemView::OnItem), #endif +#ifdef QT_KEYPAD_NAVIGATION + doneSoftKey(0), +#endif autoScroll(true), autoScrollMargin(16), autoScrollCount(0), @@ -128,6 +131,10 @@ void QAbstractItemViewPrivate::init() doDelayedItemsLayout(); q->setAttribute(Qt::WA_InputMethodEnabled); + +#ifdef QT_KEYPAD_NAVIGATION + doneSoftKey = QSoftKeyManager::createKeyedAction(QAction::EndEditSoftKey, Qt::Key_Back, q); +#endif } void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) @@ -2064,14 +2071,14 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); - QActionToKeyEventMapper::addSoftKey(QAction::BackSoftKey, Qt::Key_Back, this); + addAction(d->doneSoftKey); return; } } break; case Qt::Key_Back: if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { - QActionToKeyEventMapper::removeSoftkey(this); + removeAction(d->doneSoftKey); setEditFocus(false); } else { event->ignore(); diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 6b1ec8e..0bd272d 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -379,6 +379,10 @@ public: QAbstractItemView::DropIndicatorPosition dropIndicatorPosition; #endif +#ifdef QT_KEYPAD_NAVIGATION + QAction *doneSoftKey; +#endif + QString keyboardInput; QTime keyboardInputTime; |