diff options
author | Anton Kudryavtsev <anton.kudryavtsev@vk.team> | 2023-09-07 17:41:13 +0300 |
---|---|---|
committer | Anton Kudryavtsev <anton.kudryavtsev@vk.team> | 2023-09-08 19:17:35 +0300 |
commit | e312fbc990bf6e59dab5eb2818e9cd1c5a7c9c60 (patch) | |
tree | dc8059c4fb0aef21438469afd4e0baba01553539 /src/widgets/util/qcompleter.cpp | |
parent | a9ffdc59a718f00f9d91a21df0d613b6d8fad7e1 (diff) |
qcompleter: avoid implicit detach
by const method usage
Change-Id: Iade97ee80ed9a89915e89b9f17f12b1842c1baab
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/widgets/util/qcompleter.cpp')
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 9664004455..394a968aad 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -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); } |