qcompleter: avoid implicit detach
by const method usage Change-Id: Iade97ee80ed9a89915e89b9f17f12b1842c1baab Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
a9ffdc59a7
commit
e312fbc990
@ -840,8 +840,8 @@ void QCompleterPrivate::setCurrentIndex(QModelIndex index, bool select)
|
||||
void QCompleterPrivate::_q_completionSelected(const QItemSelection& selection)
|
||||
{
|
||||
QModelIndex index;
|
||||
if (!selection.indexes().isEmpty())
|
||||
index = selection.indexes().first();
|
||||
if (const auto indexes = selection.indexes(); !indexes.isEmpty())
|
||||
index = indexes.first();
|
||||
|
||||
_q_complete(index, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user