summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-09-19 13:37:38 +0200
committerAlessandro Portale <aportale@trolltech.com>2009-09-19 13:37:38 +0200
commitcd48ed92670a0d086589b202364f38f14e7221c9 (patch)
treea3e9d51e75822a1380699d7cd5fb87ee1522239d /src/gui/itemviews/qabstractitemview.cpp
parent3581668cd0ffbe47a05ce7467f8d89b8c9bb6101 (diff)
Making Keypad Navigation more usable
All changes of this commit are #ifdef'ed in QT_KEYPAD_NAVIGATION. Most desktop Qts won't notice any change. Navigating between QWidgets was not alwys a pleasure on keypad devices. This commit fixes the navigation behavior for some widgets, mostly itemviews. Furthermore, it adds a 'directional' navigation mode. Until now, the existing keypad navigation used the tab order do go back and forth between widgets. The new mode is supposed to provide a more intuitive navigation. It is the new default mode on Symbian. Screens (and their resolutions) become bigger, and also low resolution screens can be used in landscape mode. That's why the directional mode was requested. Another popular request was to put some more convenience into QSlider: If a (horizontal) slider has focus and the user presses left/right, the value of the slider may directing change without being selected (edit mode). This commit also adds the manual test 'keypadnavigation'. Reviewed-by: Shane Kearns
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 757ded9ee8..5c689283bf 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2166,6 +2166,12 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
#endif
case Qt::Key_Left:
case Qt::Key_Right:
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) {
+ event->accept(); // don't change horizontal focus in directional mode
+ break;
+ }
+#endif // QT_KEYPAD_NAVIGATION
case Qt::Key_Home:
case Qt::Key_End:
case Qt::Key_PageUp: