diff options
Diffstat (limited to 'src/widgets/util/qcompleter.cpp')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 47fee68538..ef7207a8a3 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -1120,6 +1120,8 @@ void QCompleter::setModel(QAbstractItemModel *model) { Q_D(QCompleter); QAbstractItemModel *oldModel = d->proxy->sourceModel(); + if (oldModel == model) + return; #if QT_CONFIG(filesystemmodel) if (qobject_cast<const QFileSystemModel *>(oldModel)) setCompletionRole(Qt::EditRole); // QTBUG-54642, clear FileNameRole set by QFileSystemModel @@ -1208,7 +1210,7 @@ QCompleter::CompletionMode QCompleter::completionMode() const /*! \property QCompleter::filterMode - \brief how the filtering is performed + \brief This property controls how filtering is performed. \since 5.2 If filterMode is set to Qt::MatchStartsWith, only those entries that start @@ -1216,11 +1218,14 @@ QCompleter::CompletionMode QCompleter::completionMode() const the entries that contain the typed characters, and Qt::MatchEndsWith the ones that end with the typed characters. - Currently, only these three modes are implemented. Setting filterMode to - any other Qt::MatchFlag will issue a warning, and no action will be - performed. + Setting filterMode to any other Qt::MatchFlag will issue a warning, and no + action will be performed. Because of this, the \c Qt::MatchCaseSensitive + flag has no effect. Use the \l caseSensitivity property to control case + sensitivity. The default mode is Qt::MatchStartsWith. + + \sa caseSensitivity */ void QCompleter::setFilterMode(Qt::MatchFlags filterMode) @@ -1747,9 +1752,9 @@ void QCompleter::setMaxVisibleItems(int maxItems) \property QCompleter::caseSensitivity \brief the case sensitivity of the matching - The default is Qt::CaseSensitive. + The default value is \c Qt::CaseSensitive. - \sa completionColumn, completionRole, modelSorting + \sa completionColumn, completionRole, modelSorting, filterMode */ void QCompleter::setCaseSensitivity(Qt::CaseSensitivity cs) { |