summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-09-19 11:37:38 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-09-19 11:37:38 (GMT)
commitcd48ed92670a0d086589b202364f38f14e7221c9 (patch)
treea3e9d51e75822a1380699d7cd5fb87ee1522239d /src/gui/itemviews
parent3581668cd0ffbe47a05ce7467f8d89b8c9bb6101 (diff)
downloadQt-cd48ed92670a0d086589b202364f38f14e7221c9.zip
Qt-cd48ed92670a0d086589b202364f38f14e7221c9.tar.gz
Qt-cd48ed92670a0d086589b202364f38f14e7221c9.tar.bz2
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')
-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 757ded9..5c68928 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: