diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-10-06 16:05:17 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-07 03:05:37 (GMT) |
commit | dab2fdd3b3ac147ff251102b20dc0dca3a97bb92 (patch) | |
tree | 21ef14ad3bb0ee52386224b53c8feda88e307488 | |
parent | e5948fdb892810b5b783ceb4205a1eacd2a89a79 (diff) | |
download | Qt-dab2fdd3b3ac147ff251102b20dc0dca3a97bb92.zip Qt-dab2fdd3b3ac147ff251102b20dc0dca3a97bb92.tar.gz Qt-dab2fdd3b3ac147ff251102b20dc0dca3a97bb92.tar.bz2 |
Prevent OK key being processed twice in file dialog (keypad navigation)
All key events were being explicitly ignored by the file dialog when key
navigation is enabled, and it doesn't have edit focus.
When a file is opened by pressing the OK key, there is no edit focus
after returning from accept() and the OK key can propagate outside the
modal dialog.
This causes the parent widget to receive and act upon the OK key as well
which makes problems - e.g. in QTBUG-4724, recursive menu activation
Task-number: QTBUG-4724
Reviewed-by: Alessandro Portale
(cherry picked from commit 28cdb974cce58111a19e8691f4dd929a5c9f74ea)
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index eb5fed0..eab842f 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3149,7 +3149,7 @@ void QFileDialogListView::keyPressEvent(QKeyEvent *e) QListView::keyPressEvent(e); } #ifdef QT_KEYPAD_NAVIGATION - if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder + else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) && !hasEditFocus()) { e->ignore(); |