diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-08-16 11:30:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-09-04 21:27:33 +0200 |
commit | e82a1d6b2998b30fc100c4ebf9b98ee18dd3c374 (patch) | |
tree | 8f9f503cc128fc776e77a4d10b830a6bb0e29b46 /src/widgets/util | |
parent | efbba1e54ac6f66a3f3f5a9000ae68406c74ca8f (diff) |
Deprecate QDirModel
Deprecate the constructors, add guards.
Use a QStandardItemModel in tst_QCompleter::setters() instead.
Task-number: QTBUG-69410
Change-Id: If77298982bb3d0b5321ae1271fab3f33b196101d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 7b69eff30c..3c0271e7c2 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -473,7 +473,7 @@ QMatchData QCompletionEngine::filterHistory() if (curParts.count() <= 1 || c->proxy->showAll || !source) return QMatchData(); -#if QT_CONFIG(dirmodel) +#if QT_CONFIG(dirmodel) && QT_DEPRECATED_SINCE(5, 15) const bool isDirModel = (qobject_cast<QDirModel *>(source) != nullptr); #else const bool isDirModel = false; @@ -903,7 +903,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) QModelIndex si = proxy->mapToSource(index); si = si.sibling(si.row(), column); // for clicked() completion = q->pathFromIndex(si); -#if QT_CONFIG(dirmodel) +#if QT_CONFIG(dirmodel) && QT_DEPRECATED_SINCE(5, 15) // add a trailing separator in inline if (mode == QCompleter::InlineCompletion) { if (qobject_cast<QDirModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir()) @@ -1125,7 +1125,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setPopup(d->popup); // set the model and make new connections if (oldModel && oldModel->QObject::parent() == this) delete oldModel; -#if QT_CONFIG(dirmodel) +#if QT_CONFIG(dirmodel) && QT_DEPRECATED_SINCE(5, 15) if (qobject_cast<QDirModel *>(model)) { #if defined(Q_OS_WIN) setCaseSensitivity(Qt::CaseInsensitive); @@ -1846,7 +1846,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const return QString(); bool isDirModel = false; bool isFsModel = false; -#if QT_CONFIG(dirmodel) +#if QT_CONFIG(dirmodel) && QT_DEPRECATED_SINCE(5, 15) isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != nullptr; #endif #if QT_CONFIG(filesystemmodel) @@ -1895,7 +1895,7 @@ QStringList QCompleter::splitPath(const QString& path) const { bool isDirModel = false; bool isFsModel = false; -#if QT_CONFIG(dirmodel) +#if QT_CONFIG(dirmodel) && QT_DEPRECATED_SINCE(5, 15) Q_D(const QCompleter); isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != nullptr; #endif |