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>
This commit is contained in:
parent
61f865be00
commit
08ba111719
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user