diff options
author | João Abecasis <joao@abecasis.name> | 2009-05-07 18:53:22 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-05-08 11:28:35 (GMT) |
commit | 42b5bc2e21cbed70b64fcd1f1bcf9282444206dd (patch) | |
tree | be684bf472b4567ad02a1f1f583e70be061b5512 /src | |
parent | 813835f67a1053561eba67bf958eb39c0f4eedfe (diff) | |
download | Qt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.zip Qt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.tar.gz Qt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.tar.bz2 |
Fixes a crash in QPrinterDialog with relative filenames
It's better to set the sourceModel in the constructor for QFSCompletor,
as requiring that it be set separately is error prone.
Surprisingly, the printer dialog crash only appears to happen when using
relative filenames.
Task-number: 253135
Reviewed-by: alexis
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog_p.h | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 2f524cb..eeb2743 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -2142,7 +2142,6 @@ void QFileDialogPrivate::createWidgets() #ifndef QT_NO_COMPLETER completer = new QFSCompletor(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); - completer->sourceModel = model; QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); #endif // QT_NO_COMPLETER diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index dc24390..ab4199e 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -97,7 +97,7 @@ class Ui_QFileDialog; */ class QFSCompletor : public QCompleter { public: - QFSCompletor(QAbstractItemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(0) + QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model) { #ifdef Q_OS_WIN setCaseSensitivity(Qt::CaseInsensitive); |