diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-02 15:04:15 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-10-02 17:24:58 +0000 |
commit | 925d6eff3e8e5bc801210a67ec4cf1d4b3492fc2 (patch) | |
tree | a03f381e4823e29b2e50c1a80588f06e450656fc /src/widgets/dialogs | |
parent | a3292031295a09e5e959141db78c2310e08562ae (diff) | |
parent | d0eaa737e10aed34c09ba753e21c3e027b5ce58c (diff) |
Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index ee2b1e6dae..443213d0de 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2833,6 +2833,13 @@ void QFileDialogPrivate::createWidgets() if (qFileDialogUi) return; Q_Q(QFileDialog); + + // This function is sometimes called late (e.g as a fallback from setVisible). In that case we + // need to ensure that the following UI code (setupUI in particular) doesn't reset any explicitly + // set window state or geometry. + QSize preSize = q->testAttribute(Qt::WA_Resized) ? q->size() : QSize(); + Qt::WindowStates preState = q->windowState(); + model = new QFileSystemModel(q); model->setFilter(options->filter()); model->setObjectName(QLatin1String("qt_filesystem_model")); @@ -2878,6 +2885,9 @@ void QFileDialogPrivate::createWidgets() completer = new QFSCompleter(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); #endif // QT_NO_FSCOMPLETER + + qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText); + QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), @@ -2991,7 +3001,8 @@ void QFileDialogPrivate::createWidgets() lineEdit()->selectAll(); _q_updateOkButton(); retranslateStrings(); - q->resize(q->sizeHint()); + q->resize(preSize.isValid() ? preSize : q->sizeHint()); + q->setWindowState(preState); } void QFileDialogPrivate::_q_showHeader(QAction *action) |