QFileDialog: Only focus file name edit when becoming visible

Doing it when hiding the dialog (which happens when closing it) makes no
sense, and messes with the focus object for no reason.

Change-Id: I4831d4a9b3c22248594f52bfa3b14dc73db110b7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Tor Arne Vestbø 2017-01-03 17:45:06 +01:00
parent 8ba5fe1562
commit 33bf267e25

View File

@ -860,7 +860,7 @@ void QFileDialog::setVisible(bool visible)
}
}
if (d->usingWidgets())
if (visible && d->usingWidgets())
d->qFileDialogUi->fileNameEdit->setFocus();
QDialog::setVisible(visible);