diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-04 15:49:32 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-07 12:28:26 +0000 |
commit | 5cf308cd17f403ac07fbd239c5bea674302a445e (patch) | |
tree | c7b82426852e9f80f16e1afd868a413a262addd1 /src/qml/qml/qqmltypemodule.cpp | |
parent | 540f5b272933b0c8e377b811c85ed2478bb98997 (diff) |
Add a mutable iterator to QStringHash
And use that in QQmlTypeModule to get rid of a const_cast.
Change-Id: Ifbb39293b6f0e159355dd7780febba0eed149025
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypemodule.cpp')
-rw-r--r-- | src/qml/qml/qqmltypemodule.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypemodule.cpp b/src/qml/qml/qqmltypemodule.cpp index 35be51160f..05264abb1d 100644 --- a/src/qml/qml/qqmltypemodule.cpp +++ b/src/qml/qml/qqmltypemodule.cpp @@ -94,10 +94,8 @@ void QQmlTypeModulePrivate::add(QQmlTypePrivate *type) void QQmlTypeModulePrivate::remove(const QQmlTypePrivate *type) { - for (TypeHash::ConstIterator elementIt = typeHash.begin(); elementIt != typeHash.end();) { - QList<QQmlTypePrivate *> &list = const_cast<QList<QQmlTypePrivate *> &>(elementIt.value()); - - QQmlMetaType::removeQQmlTypePrivate(list, type); + for (TypeHash::MutableIterator elementIt = typeHash.begin(); elementIt != typeHash.end();) { + QQmlMetaType::removeQQmlTypePrivate(elementIt.value(), type); #if 0 if (list.isEmpty()) |