summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfiledialog.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-13 10:53:27 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-13 10:53:27 (GMT)
commitbecf7dc2b4b7c2609350eb3236f854c1a4a344f5 (patch)
tree9cdc7101f704a7c6b6544c3aa74f79e5f2fdd1dc /src/gui/dialogs/qfiledialog.cpp
parent3794e55c2c8427dd8bd4f86af5e894cc80267881 (diff)
parent60d2ab05c350f866f942a35f341f455015fdb800 (diff)
downloadQt-becf7dc2b4b7c2609350eb3236f854c1a4a344f5.zip
Qt-becf7dc2b4b7c2609350eb3236f854c1a4a344f5.tar.gz
Qt-becf7dc2b4b7c2609350eb3236f854c1a4a344f5.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src/gui/dialogs/qfiledialog.cpp')
-rw-r--r--src/gui/dialogs/qfiledialog.cpp55
1 files changed, 22 insertions, 33 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 6bc6b76..3b1befd 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -3022,12 +3022,6 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) {
case Qt::Key_Escape:
q->hide();
return true;
-#ifdef QT_KEYPAD_NAVIGATION
- case Qt::Key_Down:
- case Qt::Key_Up:
- return (QApplication::navigationMode() != Qt::NavigationModeKeypadTabOrder
- && QApplication::navigationMode() != Qt::NavigationModeKeypadDirectional);
-#endif
default:
break;
}
@@ -3145,20 +3139,16 @@ QSize QFileDialogListView::sizeHint() const
void QFileDialogListView::keyPressEvent(QKeyEvent *e)
{
- if (!d_ptr->itemViewKeyboardEvent(e)) {
- QListView::keyPressEvent(e);
- }
#ifdef QT_KEYPAD_NAVIGATION
- else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
- || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional)
- && !hasEditFocus()) {
- e->ignore();
- } else {
- e->accept();
+ if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) {
+ QListView::keyPressEvent(e);
+ return;
}
-#else
+#endif // QT_KEYPAD_NAVIGATION
+
+ if (!d_ptr->itemViewKeyboardEvent(e))
+ QListView::keyPressEvent(e);
e->accept();
-#endif
}
QFileDialogTreeView::QFileDialogTreeView(QWidget *parent) : QTreeView(parent)
@@ -3184,20 +3174,16 @@ void QFileDialogTreeView::init(QFileDialogPrivate *d_pointer)
void QFileDialogTreeView::keyPressEvent(QKeyEvent *e)
{
- if (!d_ptr->itemViewKeyboardEvent(e)) {
- QTreeView::keyPressEvent(e);
- }
#ifdef QT_KEYPAD_NAVIGATION
- else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
- || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional)
- && !hasEditFocus()) {
- e->ignore();
- } else {
- e->accept();
+ if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) {
+ QTreeView::keyPressEvent(e);
+ return;
}
-#else
+#endif // QT_KEYPAD_NAVIGATION
+
+ if (!d_ptr->itemViewKeyboardEvent(e))
+ QTreeView::keyPressEvent(e);
e->accept();
-#endif
}
QSize QFileDialogTreeView::sizeHint() const
@@ -3213,13 +3199,16 @@ QSize QFileDialogTreeView::sizeHint() const
*/
void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
{
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) {
+ QLineEdit::keyPressEvent(e);
+ return;
+ }
+#endif // QT_KEYPAD_NAVIGATION
+
int key = e->key();
QLineEdit::keyPressEvent(e);
- if (key != Qt::Key_Escape
-#ifdef QT_KEYPAD_NAVIGATION
- && QApplication::navigationMode() == Qt::NavigationModeNone
-#endif
- )
+ if (key != Qt::Key_Escape)
e->accept();
if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) {
e->accept();