diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-03-13 15:11:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-14 22:39:39 +0100 |
commit | 08ba111719c8c4809e80e1dc8a1956dcfdd9d80d (patch) | |
tree | 9c5f0b470f5115a710fb939f4f09a98fcd8a1c31 /src/widgets | |
parent | 61f865be00e18111348641eff35cf34f83e70c13 (diff) |
Don't block Key_Back in file dialog
Update the 10 year old FIXME hack to allow Key_Back (which will
close the dialog on Android). Also clean up nearby code that has
been dead for seven years.
Task-number: QTBUG-35784
Change-Id: I609858afb2caefe7025e421406288ae56717fea5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 7 | ||||
-rw-r--r-- | src/widgets/dialogs/qfiledialog_p.h | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 3e4490e890..bea92e9f84 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -3904,13 +3904,8 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) int key = e->key(); QLineEdit::keyPressEvent(e); - if (key != Qt::Key_Escape) + if (key != Qt::Key_Escape && key != Qt::Key_Back) e->accept(); - if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) { - e->accept(); - hide(); - d_ptr->currentView()->setFocus(Qt::ShortcutFocusReason); - } } #ifndef QT_NO_FSCOMPLETER diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index faa721572c..632bbca5a4 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -286,7 +286,7 @@ private: class QFileDialogLineEdit : public QLineEdit { public: - QFileDialogLineEdit(QWidget *parent = 0) : QLineEdit(parent), hideOnEsc(false), d_ptr(0){} + QFileDialogLineEdit(QWidget *parent = 0) : QLineEdit(parent), d_ptr(0){} void setFileDialogPrivate(QFileDialogPrivate *d_pointer) {d_ptr = d_pointer; } void keyPressEvent(QKeyEvent *e); bool hideOnEsc; |