summaryrefslogtreecommitdiffstats
path: root/src/widgets/util/qcompleter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/util/qcompleter.cpp')
-rw-r--r--src/widgets/util/qcompleter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 3006f0c9ce..5a31eb4e52 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -493,7 +493,7 @@ QMatchData QCompletionEngine::filterHistory()
bool QCompletionEngine::matchHint(QString part, const QModelIndex& parent, QMatchData *hint)
{
if (c->cs == Qt::CaseInsensitive)
- part = part.toLower();
+ part = std::move(part).toLower();
const CacheItem& map = cache[parent];
@@ -512,7 +512,7 @@ bool QCompletionEngine::matchHint(QString part, const QModelIndex& parent, QMatc
bool QCompletionEngine::lookupCache(QString part, const QModelIndex& parent, QMatchData *m)
{
if (c->cs == Qt::CaseInsensitive)
- part = part.toLower();
+ part = std::move(part).toLower();
const CacheItem& map = cache[parent];
if (!map.contains(part))
return false;
@@ -548,7 +548,7 @@ void QCompletionEngine::saveInCache(QString part, const QModelIndex& parent, con
}
if (c->cs == Qt::CaseInsensitive)
- part = part.toLower();
+ part = std::move(part).toLower();
cache[parent][part] = m;
}
@@ -558,7 +558,7 @@ QIndexMapper QSortedModelEngine::indexHint(QString part, const QModelIndex& pare
const QAbstractItemModel *model = c->proxy->sourceModel();
if (c->cs == Qt::CaseInsensitive)
- part = part.toLower();
+ part = std::move(part).toLower();
const CacheItem& map = cache[parent];
@@ -1347,11 +1347,12 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
}
// default implementation for keys not handled by the widget when popup is open
+#if QT_CONFIG(shortcut)
if (ke->matches(QKeySequence::Cancel)) {
d->popup->hide();
return true;
}
-
+#endif
switch (key) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select: