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>
This commit is contained in:
hjk
2020-08-12 09:40:51 +02:00
parent 0c4135e380
commit 89296a98a0
7 changed files with 27 additions and 11 deletions

View File

@@ -697,8 +697,13 @@ void FakeVimExCommandsPage::apply()
}
settings->endArray();
globalCommandMapping.clear();
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
globalCommandMapping.insert(defaultMap);
globalCommandMapping.insert(newMapping);
#else
globalCommandMapping.unite(defaultMap);
globalCommandMapping.unite(newMapping);
#endif
}
}
@@ -950,8 +955,13 @@ void FakeVimUserCommandsPage::apply()
}
settings->endArray();
userMap.clear();
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
userMap.insert(dd->m_defaultUserCommandMap);
userMap.insert(current);
#else
userMap.unite(dd->m_defaultUserCommandMap);
userMap.unite(current);
#endif
}
}