Although used mostly in the same files, they're separate types, so define them in separate places. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I9e64b382ad48f9a74e432ccd49b6f5fcc9316da3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
25 lines
581 B
C++
25 lines
581 B
C++
// Copyright (C) 2018 Intel Corporation.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#ifndef VARIANTORDEREDMAP_H
|
|
#define VARIANTORDEREDMAP_H
|
|
|
|
#include <QList>
|
|
#include <QPair>
|
|
#include <QVariant>
|
|
#include <QVariantMap>
|
|
|
|
class VariantOrderedMap : public QList<QPair<QVariant, QVariant>>
|
|
{
|
|
public:
|
|
VariantOrderedMap() = default;
|
|
VariantOrderedMap(const QVariantMap &map)
|
|
{
|
|
reserve(map.size());
|
|
for (auto it = map.begin(); it != map.end(); ++it)
|
|
append({it.key(), it.value()});
|
|
}
|
|
};
|
|
|
|
#endif // VARIANTORDEREDMAP_H
|