forked from qt-creator/qt-creator
Work around QHash::unite deprecation
Change-Id: Ibf199b5e3f2ca99b7e0cafe20893a509d9eab906 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
@@ -1298,4 +1299,14 @@ QList<T> toList(const QSet<T> &set)
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
void addToHash(QHash<Key, T> *result, const QHash<Key, T> &additionalContents)
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
result->unite(additionalContents);
|
||||
#else
|
||||
result->insert(additionalContents);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user