summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-07-09 16:04:32 (GMT)
committeraxis <qt-info@nokia.com>2009-07-09 16:09:29 (GMT)
commit7c21c773d736d86f3c5c4f5c42dd49da17a11ef7 (patch)
treeb7b73d6f7b5d215d500975af2fa0e425597d122d /src/gui/widgets
parent44f1d4da465b22b280ef958f7a54622c24a7611d (diff)
downloadQt-7c21c773d736d86f3c5c4f5c42dd49da17a11ef7.zip
Qt-7c21c773d736d86f3c5c4f5c42dd49da17a11ef7.tar.gz
Qt-7c21c773d736d86f3c5c4f5c42dd49da17a11ef7.tar.bz2
Restructured some code that had flawed logic.
A different codepath was taken when QT_KEYPAD_NAVIGATION was defined, despite keypad navigation itself being off. Now it should behave the same in both cases. This helped the autotests to pass on Symbian. AutoTest: Passed RevBy: Trust me
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qdatetimeedit.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp
index e74a47c..00ac880 100644
--- a/src/gui/widgets/qdatetimeedit.cpp
+++ b/src/gui/widgets/qdatetimeedit.cpp
@@ -1126,23 +1126,25 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
case Qt::Key_Left:
case Qt::Key_Right:
if (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) {
+ if (
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled() || !hasEditFocus()) {
- select = false;
- break;
- }
-#else
- if (!(event->modifiers() & Qt::ControlModifier)) {
+ QApplication::keypadNavigationEnabled() && !hasEditFocus()
+ || !QApplication::keypadNavigationEnabled() &&
+#endif
+ !(event->modifiers() & Qt::ControlModifier)) {
select = false;
break;
}
#ifdef Q_WS_MAC
- else {
+ else
+#ifdef QT_KEYPAD_NAVIGATION
+ if (!QApplication::keypadNavigationEnabled())
+#endif
+ {
select = (event->modifiers() & Qt::ShiftModifier);
break;
}
#endif
-#endif // QT_KEYPAD_NAVIGATION
}
// else fall through
case Qt::Key_Backtab: