1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: MIT
#include <QtCore>
#include <unordered_map>
#include <unordered_set>
class ContainerTypes : public QObject
{
Q_OBJECT
public:
using QObject::QObject;
QByteArrayList qByteArrayList = {
"one",
"two",
"three",
};
QHash<int, QString> qHash = {
{10, "one"},
{20, "two"},
{30, "three"},
};
QMap<int, QString> qMap = {
{10, "one"},
{20, "two"},
{30, "three"},
};
QMultiHash<int, QString> qMultiHash = {
{10, "one"},
{10, "two"},
{10, "three"},
{20, "four"},
};
QSet<QString> qSet = {
"one",
"two",
"three",
"four",
};
QStringList qStringList = {
"one",
"two",
"three",
};
QVarLengthArray<QString, 4> qVarLengthArray = {
"one",
"two",
"three",
"four",
};
std::map<int, QString> stdMap = {
{10, "one"},
{20, "two"},
{30, "three"},
};
std::unordered_map<int, QString> stdUnorderedMap = {
{10, "one"},
{20, "two"},
{30, "three"},
};
std::unordered_multimap<int, QString> stdUnorderedMultimap = {
{10, "one"},
{10, "two"},
{10, "three"},
{20, "four"},
};
std::unordered_set<std::string> stdSet = {
"one",
"two",
"three",
"four",
};
};
|