From 08ba111719c8c4809e80e1dc8a1956dcfdd9d80d Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 13 Mar 2014 15:11:22 +0100 Subject: 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 --- src/widgets/dialogs/qfiledialog.cpp | 7 +------ src/widgets/dialogs/qfiledialog_p.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/widgets') 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; -- cgit v1.2.3