summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview.cpp')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 51aea4079a1..6288aae096a 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -3108,7 +3108,8 @@ void QAbstractItemView::keyboardSearch(const QString &search)
QModelIndex startMatch;
QModelIndexList previous;
do {
- match = d->model->match(current, Qt::DisplayRole, d->keyboardInput);
+ match = d->model->match(current, Qt::DisplayRole, d->keyboardInput, 1,
+ d->keyboardSearchFlags);
if (match == previous)
break;
firstMatch = match.value(0);
@@ -3251,6 +3252,30 @@ void QAbstractItemView::setUpdateThreshold(int threshold)
}
/*!
+ \property QAbstractItemView::keyboardSearchFlags
+ \since 6.11
+ This property determines how the default implementation of
+ keyboardSearch() matches the given string against the model's data.
+
+ The default value is \c{Qt::MatchStartsWith|Qt::MatchWrap}.
+
+ \sa keyboardSearch()
+ \sa QAbstractItemModel::match()
+*/
+
+Qt::MatchFlags QAbstractItemView::keyboardSearchFlags() const
+{
+ Q_D(const QAbstractItemView);
+ return d->keyboardSearchFlags;
+}
+
+void QAbstractItemView::setKeyboardSearchFlags(Qt::MatchFlags searchFlags)
+{
+ Q_D(QAbstractItemView);
+ d->keyboardSearchFlags = searchFlags;
+}
+
+/*!
Opens a persistent editor on the item at the given \a index.
If no editor exists, the delegate will create a new editor.