summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/texteditoroverlay.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-08-12 09:40:51 +0200
committerhjk <hjk@qt.io>2020-08-13 12:11:36 +0000
commit89296a98a01a1fcdd84624ead9a9454e653b9e08 (patch)
treef7dd8eb381bd53f284e1ba12418df340aa76ddc9 /src/plugins/texteditor/texteditoroverlay.cpp
parent0c4135e38097d482ce586b65867ec61185f703f1 (diff)
downloadqt-creator-89296a98a01a1fcdd84624ead9a9454e653b9e08.tar.gz
Qt6: Adapt to removed QMap functionality
QMap::iterator::operator+() was removed in 14090760a8, necessitating extra code using std::next/prev to workaround. QMap::unite is gone, the replacement QMap::insert was only introduced in 5.15. QMap key values need to have an operator==() available. Task-number: QTCREATORBUG-24098 Change-Id: Ic4cf429ab18cad58b1218180de40eb65586afd77 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoroverlay.cpp')
-rw-r--r--src/plugins/texteditor/texteditoroverlay.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp
index b923b257c3..863db175c9 100644
--- a/src/plugins/texteditor/texteditoroverlay.cpp
+++ b/src/plugins/texteditor/texteditoroverlay.cpp
@@ -486,16 +486,16 @@ void TextEditorOverlay::mapEquivalentSelections()
m_equivalentSelections.clear();
m_equivalentSelections.resize(m_selections.size());
- QMap<QString, int> all;
+ QMultiMap<QString, int> all;
for (int i = 0; i < m_selections.size(); ++i)
- all.insertMulti(selectionText(i).toLower(), i);
+ all.insert(selectionText(i).toLower(), i);
const QList<QString> &uniqueKeys = all.uniqueKeys();
foreach (const QString &key, uniqueKeys) {
QList<int> indexes;
const auto cAll = all;
- QMap<QString, int>::const_iterator lbit = cAll.lowerBound(key);
- QMap<QString, int>::const_iterator ubit = cAll.upperBound(key);
+ QMultiMap<QString, int>::const_iterator lbit = cAll.lowerBound(key);
+ QMultiMap<QString, int>::const_iterator ubit = cAll.upperBound(key);
while (lbit != ubit) {
indexes.append(lbit.value());
++lbit;