From 43837f38b23e46b2b26599b30724902ce6eddabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 27 Nov 2019 17:13:13 +0100 Subject: Change some uses of QMap::insertMulti to QMultiMap::insert By casting it, these are situations where we cannot change the type itself to QMultiMap. For QVariant it's a public define and for dbus it's the type of an argument to the function. Change-Id: I0f385dc857fce5de3e8254d18268fd84a6d7707c Reviewed-by: Lars Knoll --- src/corelib/kernel/qvariant.cpp | 2 +- src/corelib/kernel/qvariant.h | 2 +- src/dbus/qdbusargument.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 5e27119729..c00efc0afe 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -944,7 +944,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) const QVariantHash *hash = v_cast(d); const auto end = hash->end(); for (auto it = hash->begin(); it != end; ++it) - map->insertMulti(it.key(), it.value()); + static_cast *>(map)->insert(it.key(), it.value()); #ifndef QT_BOOTSTRAPPED } else if (d->type == QMetaType::QCborValue) { if (!v_cast(d)->isMap()) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 6739643f89..0dddfc59b3 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -841,7 +841,7 @@ namespace QtPrivate { QAssociativeIterable iter = QVariantValueHelperInterface::invoke(v); QVariantMap l; for (QAssociativeIterable::const_iterator it = iter.begin(), end = iter.end(); it != end; ++it) - l.insertMulti(it.key().toString(), it.value()); + static_cast &>(l).insert(it.key().toString(), it.value()); return l; } return QVariantValueHelper::invoke(v); diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 340f11bf5d..477bd1e8fd 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -321,7 +321,7 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, QMap &m T value; arg.beginMapEntry(); arg >> key >> value; - map.insertMulti(key, value); + static_cast &>(map).insert(key, value); arg.endMapEntry(); } arg.endMap(); -- cgit v1.2.3