Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qjsonarray.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QJSONARRAY_H
5#define QJSONARRAY_H
6
7#include <QtCore/qjsonvalue.h>
8#include <QtCore/qiterator.h>
9#include <QtCore/qshareddata.h>
10#include <initializer_list>
11
13
14class QDebug;
15typedef QList<QVariant> QVariantList;
16
17class Q_CORE_EXPORT QJsonArray
18{
19public:
21
22 QJsonArray(std::initializer_list<QJsonValue> args);
23
25
26 QJsonArray(const QJsonArray &other) noexcept;
27 QJsonArray &operator =(const QJsonArray &other) noexcept;
28
29 QJsonArray(QJsonArray &&other) noexcept;
30
31 QJsonArray &operator =(QJsonArray &&other) noexcept
32 {
33 swap(other);
34 return *this;
35 }
36
37 static QJsonArray fromStringList(const QStringList &list);
38 static QJsonArray fromVariantList(const QVariantList &list);
39 QVariantList toVariantList() const;
40
41 qsizetype size() const;
42 inline qsizetype count() const { return size(); }
43
44 bool isEmpty() const;
45 QJsonValue at(qsizetype i) const;
46 QJsonValue first() const;
47 QJsonValue last() const;
48
49 void prepend(const QJsonValue &value);
50 void append(const QJsonValue &value);
51 void removeAt(qsizetype i);
52 QJsonValue takeAt(qsizetype i);
53 inline void removeFirst() { removeAt(0); }
54 inline void removeLast() { removeAt(size() - 1); }
55
56 void insert(qsizetype i, const QJsonValue &value);
57 void replace(qsizetype i, const QJsonValue &value);
58
59 bool contains(const QJsonValue &element) const;
60 QJsonValueRef operator[](qsizetype i);
61 QJsonValue operator[](qsizetype i) const;
62
63#if QT_CORE_REMOVED_SINCE(6, 8)
64 bool operator==(const QJsonArray &other) const;
65 bool operator!=(const QJsonArray &other) const;
66#endif
67 void swap(QJsonArray &other) noexcept
68 {
69 a.swap(other.a);
70 }
71
72 class const_iterator;
73
74 class iterator {
75 public:
76 typedef std::random_access_iterator_tag iterator_category;
81
82 inline iterator() : item(static_cast<QJsonArray *>(nullptr), 0) { }
84
85 constexpr iterator(const iterator &other) = default;
87 {
88 item.rebind(other.item);
89 return *this;
90 }
91
92 inline QJsonValueRef operator*() const { return item; }
93 inline const QJsonValueConstRef *operator->() const { return &item; }
94 inline QJsonValueRef *operator->() { return &item; }
95 inline QJsonValueRef operator[](qsizetype j) const { return *(*this + j); }
96
97#if QT_CORE_REMOVED_SINCE(6, 8)
98 inline bool operator==(const iterator &o) const
99 { return item.d == o.item.d && item.index == o.item.index; }
100 inline bool operator!=(const iterator &o) const { return !operator==(o); }
101 inline bool operator<(const iterator &other) const
102 { Q_ASSERT(item.d == other.item.d); return item.index < other.item.index; }
103 inline bool operator<=(const iterator &other) const
104 { Q_ASSERT(item.d == other.item.d); return item.index <= other.item.index; }
105 inline bool operator>(const iterator &other) const { return !operator<=(other); }
106 inline bool operator>=(const iterator &other) const { return !operator<(other); }
107 inline bool operator==(const const_iterator &o) const
108 { return item.d == o.item.d && item.index == o.item.index; }
109 inline bool operator!=(const const_iterator &o) const { return !operator==(o); }
110 inline bool operator<(const const_iterator &other) const
111 { Q_ASSERT(item.d == other.item.d); return item.index < other.item.index; }
112 inline bool operator<=(const const_iterator &other) const
113 { Q_ASSERT(item.d == other.item.d); return item.index <= other.item.index; }
114 inline bool operator>(const const_iterator &other) const { return !operator<=(other); }
115 inline bool operator>=(const const_iterator &other) const { return !operator<(other); }
116#endif
117 inline iterator &operator++() { ++item.index; return *this; }
118 inline iterator operator++(int) { iterator n = *this; ++item.index; return n; }
119 inline iterator &operator--() { item.index--; return *this; }
120 inline iterator operator--(int) { iterator n = *this; item.index--; return n; }
121 inline iterator &operator+=(qsizetype j) { item.index += quint64(j); return *this; }
122 inline iterator &operator-=(qsizetype j) { item.index -= quint64(j); return *this; }
123 inline iterator operator+(qsizetype j) const { iterator r = *this; return r += j; }
124 inline iterator operator-(qsizetype j) const { return operator+(-j); }
125 inline qsizetype operator-(iterator j) const { return item.index - j.item.index; }
126
127 private:
128 // Helper functions
129 static bool comparesEqual_helper(const iterator &lhs, const iterator &rhs) noexcept
130 {
131 return lhs.item.d == rhs.item.d && lhs.item.index == rhs.item.index;
132 }
133
134 static bool comparesEqual_helper(const iterator &lhs, const const_iterator &rhs) noexcept
135 {
136 return lhs.item.d == rhs.item.d && lhs.item.index == rhs.item.index;
137 }
138
139 static Qt::strong_ordering compareThreeWay_helper(const iterator &lhs,
140 const iterator &rhs) noexcept
141 {
142 Q_ASSERT(lhs.item.d == rhs.item.d);
143 return Qt::compareThreeWay(lhs.item.index, rhs.item.index);
144 }
145
146 static Qt::strong_ordering compareThreeWay_helper(const iterator &lhs,
147 const const_iterator &rhs) noexcept
148 {
149 Q_ASSERT(lhs.item.d == rhs.item.d);
150 return Qt::compareThreeWay(lhs.item.index, rhs.item.index);
151 }
152
153 // Compare friends
154 friend bool comparesEqual(const iterator &lhs, const iterator &rhs) noexcept
155 {
156 return comparesEqual_helper(lhs, rhs);
157 }
159 const iterator &rhs) noexcept
160 {
161 return compareThreeWay_helper(lhs, rhs);
162 }
164 friend bool comparesEqual(const iterator &lhs, const const_iterator &rhs) noexcept
165 {
166 return comparesEqual_helper(lhs, rhs);
167 }
169 const const_iterator &rhs) noexcept
170 {
171 return compareThreeWay_helper(lhs, rhs);
172 }
174
176 friend class QJsonArray;
177 };
178 friend class iterator;
179
181 public:
182 typedef std::random_access_iterator_tag iterator_category;
186 typedef const QJsonValueRef *pointer;
187
188 inline const_iterator() : item(static_cast<QJsonArray *>(nullptr), 0) { }
190 : item(const_cast<QJsonArray *>(array), index) { }
191 inline const_iterator(const iterator &o) : item(o.item) { }
192
193 constexpr const_iterator(const const_iterator &other) = default;
195 {
196 item.rebind(other.item);
197 return *this;
198 }
199
200 inline const QJsonValueConstRef operator*() const { return item; }
201 inline const QJsonValueConstRef *operator->() const { return &item; }
202
203 inline QJsonValueConstRef operator[](qsizetype j) const { return *(*this + j); }
204#if QT_CORE_REMOVED_SINCE(6, 8)
205 inline bool operator==(const const_iterator &o) const
206 { return item.d == o.item.d && item.index == o.item.index; }
207 inline bool operator!=(const const_iterator &o) const { return !operator==(o); }
208 inline bool operator<(const const_iterator &other) const
209 { Q_ASSERT(item.d == other.item.d); return item.index < other.item.index; }
210 inline bool operator<=(const const_iterator &other) const
211 { Q_ASSERT(item.d == other.item.d); return item.index <= other.item.index; }
212 inline bool operator>(const const_iterator &other) const { return !operator<=(other); }
213 inline bool operator>=(const const_iterator &other) const { return !operator<(other); }
214#endif
215 inline const_iterator &operator++() { ++item.index; return *this; }
216 inline const_iterator operator++(int) { const_iterator n = *this; ++item.index; return n; }
217 inline const_iterator &operator--() { item.index--; return *this; }
218 inline const_iterator operator--(int) { const_iterator n = *this; item.index--; return n; }
219 inline const_iterator &operator+=(qsizetype j) { item.index += quint64(j); return *this; }
220 inline const_iterator &operator-=(qsizetype j) { item.index -= quint64(j); return *this; }
221 inline const_iterator operator+(qsizetype j) const { const_iterator r = *this; return r += j; }
222 inline const_iterator operator-(qsizetype j) const { return operator+(-j); }
223 inline qsizetype operator-(const_iterator j) const { return item.index - j.item.index; }
224
225 private:
226 // Helper functions
227 static bool comparesEqual_helper(const const_iterator &lhs,
228 const const_iterator &rhs) noexcept
229 {
230 return lhs.item.d == rhs.item.d && lhs.item.index == rhs.item.index;
231 }
232 static Qt::strong_ordering compareThreeWay_helper(const const_iterator &lhs,
233 const const_iterator &rhs) noexcept
234 {
235 Q_ASSERT(lhs.item.d == rhs.item.d);
236 return Qt::compareThreeWay(lhs.item.index, rhs.item.index);
237 }
238
239 // Compare friends
240 friend bool comparesEqual(const const_iterator &lhs, const const_iterator &rhs) noexcept
241 {
242 return comparesEqual_helper(lhs, rhs);
243 }
245 const const_iterator &rhs) noexcept
246 {
247 return compareThreeWay_helper(lhs, rhs);
248 }
251 friend class QJsonArray;
252 };
253 friend class const_iterator;
254
255 // stl style
256 inline iterator begin() { detach(); return iterator(this, 0); }
257 inline const_iterator begin() const { return const_iterator(this, 0); }
258 inline const_iterator constBegin() const { return const_iterator(this, 0); }
259 inline const_iterator cbegin() const { return const_iterator(this, 0); }
260 inline iterator end() { detach(); return iterator(this, size()); }
261 inline const_iterator end() const { return const_iterator(this, size()); }
262 inline const_iterator constEnd() const { return const_iterator(this, size()); }
263 inline const_iterator cend() const { return const_iterator(this, size()); }
265 { insert(before.item.index, value); return before; }
267 { removeAt(it.item.index); return it; }
268
269 // more Qt
272
273 // convenience
274 inline QJsonArray operator+(const QJsonValue &v) const
275 { QJsonArray n = *this; n += v; return n; }
277 { append(v); return *this; }
279 { append(v); return *this; }
280
281 // stl compatibility
282 inline void push_back(const QJsonValue &t) { append(t); }
283 inline void push_front(const QJsonValue &t) { prepend(t); }
284 inline void pop_front() { removeFirst(); }
285 inline void pop_back() { removeLast(); }
286 inline bool empty() const { return isEmpty(); }
290 typedef const value_type *const_pointer;
294
295private:
296 friend class QJsonValue;
297 friend class QJsonValueConstRef;
298 friend class QJsonValueRef;
300 friend class QJsonDocument;
301 friend class QCborArray;
302 friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonArray &);
303
304 friend Q_CORE_EXPORT bool comparesEqual(const QJsonArray &lhs,
305 const QJsonArray &rhs) noexcept;
306
307 friend Q_CORE_EXPORT bool comparesEqual(const QJsonArray &lhs,
308 const QJsonValue &rhs) noexcept;
311
313 bool detach(qsizetype reserve = 0);
314
315 QExplicitlySharedDataPointer<QCborContainerPrivate> a;
316};
317
318Q_DECLARE_SHARED(QJsonArray)
319
320#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
322 : d(a ? a->a.data() : nullptr), is_object(false), index(idx)
323{}
324#endif
325
326Q_CORE_EXPORT size_t qHash(const QJsonArray &array, size_t seed = 0);
327
328#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
329Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonArray &);
330#endif
331
332#ifndef QT_NO_DATASTREAM
333Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QJsonArray &);
334Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QJsonArray &);
335#endif
336
338
339#endif // QJSONARRAY_H
\inmodule QtCore\reentrant
Definition qcborarray.h:20
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtCore
QJsonValueConstRef operator[](qsizetype j) const
Returns the item at offset j from the item pointed to by this iterator (the item at position {*this +...
Definition qjsonarray.h:203
qsizetype operator-(const_iterator j) const
Returns the number of items between the item pointed to by other and the item pointed to by this iter...
Definition qjsonarray.h:223
const QJsonValueConstRef operator*() const
Returns the current item.
Definition qjsonarray.h:200
const_iterator(const iterator &o)
Constructs a copy of other.
Definition qjsonarray.h:191
const_iterator & operator=(const const_iterator &other)
Definition qjsonarray.h:194
const_iterator & operator-=(qsizetype j)
Makes the iterator go back by j items.
Definition qjsonarray.h:220
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
Definition qjsonarray.h:182
const_iterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns an ...
Definition qjsonarray.h:215
const_iterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns an iterator to the new c...
Definition qjsonarray.h:217
const_iterator(const QJsonArray *array, qsizetype index)
Definition qjsonarray.h:189
friend Qt::strong_ordering compareThreeWay(const const_iterator &lhs, const const_iterator &rhs) noexcept
Definition qjsonarray.h:244
const_iterator operator-(qsizetype j) const
Returns an iterator to the item at j positions backward from this iterator.
Definition qjsonarray.h:222
const QJsonValueConstRef * operator->() const
Returns a pointer to the current item.
Definition qjsonarray.h:201
const QJsonValueRef * pointer
Definition qjsonarray.h:186
constexpr const_iterator(const const_iterator &other)=default
const QJsonValueRef reference
Definition qjsonarray.h:185
friend bool comparesEqual(const const_iterator &lhs, const const_iterator &rhs) noexcept
Definition qjsonarray.h:240
const_iterator operator+(qsizetype j) const
Returns an iterator to the item at j positions forward from this iterator.
Definition qjsonarray.h:221
const_iterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:216
const_iterator()
Constructs an uninitialized iterator.
Definition qjsonarray.h:188
const_iterator & operator+=(qsizetype j)
Advances the iterator by j items.
Definition qjsonarray.h:219
const_iterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:218
\inmodule QtCore
Definition qjsonarray.h:74
iterator & operator+=(qsizetype j)
Advances the iterator by j items.
Definition qjsonarray.h:121
iterator & operator++()
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns an ...
Definition qjsonarray.h:117
iterator & operator--()
The prefix {–} operator, {–it}, makes the preceding item current and returns an iterator to the new c...
Definition qjsonarray.h:119
qsizetype operator-(iterator j) const
Returns the number of items between the item pointed to by other and the item pointed to by this iter...
Definition qjsonarray.h:125
iterator & operator=(const iterator &other)
Definition qjsonarray.h:86
iterator operator+(qsizetype j) const
Returns an iterator to the item at j positions forward from this iterator.
Definition qjsonarray.h:123
QJsonValueRef * operator->()
Definition qjsonarray.h:94
const QJsonValueConstRef * operator->() const
Returns a pointer to a modifiable reference to the current item.
Definition qjsonarray.h:93
iterator(QJsonArray *array, qsizetype index)
Definition qjsonarray.h:83
QJsonValueRef operator*() const
Returns a modifiable reference to the current item.
Definition qjsonarray.h:92
iterator operator-(qsizetype j) const
Returns an iterator to the item at j positions backward from this iterator.
Definition qjsonarray.h:124
QJsonValueRef operator[](qsizetype j) const
Returns a modifiable reference to the item at offset j from the item pointed to by this iterator (the...
Definition qjsonarray.h:95
constexpr iterator(const iterator &other)=default
iterator()
Constructs an uninitialized iterator.
Definition qjsonarray.h:82
QJsonValueRef * pointer
Definition qjsonarray.h:80
friend bool comparesEqual(const iterator &lhs, const iterator &rhs) noexcept
Definition qjsonarray.h:154
std::random_access_iterator_tag iterator_category
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
Definition qjsonarray.h:76
friend Qt::strong_ordering compareThreeWay(const iterator &lhs, const const_iterator &rhs) noexcept
Definition qjsonarray.h:168
qsizetype difference_type
Definition qjsonarray.h:77
friend Qt::strong_ordering compareThreeWay(const iterator &lhs, const iterator &rhs) noexcept
Definition qjsonarray.h:158
iterator operator--(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:120
QJsonValue value_type
Definition qjsonarray.h:78
iterator operator++(int)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:118
iterator & operator-=(qsizetype j)
Makes the iterator go back by j items.
Definition qjsonarray.h:122
QJsonValueRef reference
Definition qjsonarray.h:79
\inmodule QtCore\reentrant
Definition qjsonarray.h:18
void pop_front()
This function is provided for STL compatibility.
Definition qjsonarray.h:284
bool empty() const
This function is provided for STL compatibility.
Definition qjsonarray.h:286
~QJsonArray()
Deletes the array.
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
Definition qjsonarray.h:260
qsizetype difference_type
Typedef for qsizetype.
Definition qjsonarray.h:293
QJsonArray(const QJsonArray &other) noexcept
Creates a copy of other.
qsizetype size_type
Typedef for qsizetype.
Definition qjsonarray.h:287
iterator Iterator
Qt-style synonym for QJsonArray::iterator.
Definition qjsonarray.h:270
const_iterator end() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:261
QJsonArray()
Creates an empty array.
QJsonValue const_reference
Typedef for const QJsonValue &.
Definition qjsonarray.h:292
QJsonArray operator+(const QJsonValue &v) const
Returns an array that contains all the items in this array followed by the provided value.
Definition qjsonarray.h:274
iterator insert(iterator before, const QJsonValue &value)
Inserts value before the position pointed to by before, and returns an iterator pointing to the newly...
Definition qjsonarray.h:264
value_type * pointer
Typedef for QJsonValue *.
Definition qjsonarray.h:289
const_iterator cend() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
Definition qjsonarray.h:263
void pop_back()
This function is provided for STL compatibility.
Definition qjsonarray.h:285
void push_front(const QJsonValue &t)
This function is provided for STL compatibility.
Definition qjsonarray.h:283
const_iterator constBegin() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the array.
Definition qjsonarray.h:258
const_iterator constEnd() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
Definition qjsonarray.h:262
QJsonValueRef reference
Typedef for QJsonValue &.
Definition qjsonarray.h:291
void removeFirst()
Removes the first item in the array.
Definition qjsonarray.h:53
iterator erase(iterator it)
Removes the item pointed to by it, and returns an iterator pointing to the next item.
Definition qjsonarray.h:266
const_iterator cbegin() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the array.
Definition qjsonarray.h:259
qsizetype count() const
Same as size().
Definition qjsonarray.h:42
QJsonArray & operator+=(const QJsonValue &v)
Appends value to the array, and returns a reference to the array itself.
Definition qjsonarray.h:276
const value_type * const_pointer
Typedef for const QJsonValue *.
Definition qjsonarray.h:290
void swap(QJsonArray &other) noexcept
Definition qjsonarray.h:67
const_iterator begin() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qjsonarray.h:257
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the array.
Definition qjsonarray.h:256
const_iterator ConstIterator
Qt-style synonym for QJsonArray::const_iterator.
Definition qjsonarray.h:271
QJsonValue value_type
Typedef for QJsonValue.
Definition qjsonarray.h:288
void push_back(const QJsonValue &t)
This function is provided for STL compatibility.
Definition qjsonarray.h:282
void removeLast()
Removes the last item in the array.
Definition qjsonarray.h:54
\inmodule QtCore\reentrant
QJsonValueConstRef(const QJsonValueConstRef &)=default
\inmodule QtCore \reentrant
\inmodule QtCore\reentrant
Definition qjsonvalue.h:25
\inmodule QtCore
\inmodule QtCore \title Classes and helpers for defining comparison operators \keyword qtcompare
Definition qcompare.h:400
list append(new Employee("Blackpool", "Stephen"))
cache insert(employee->id(), employee)
QSet< QString >::iterator it
set reserve(20000)
Combined button and popup list for selecting options.
constexpr Qt::strong_ordering compareThreeWay(LeftInt lhs, RightInt rhs) noexcept
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
#define Q_DECLARE_STRONGLY_ORDERED(...)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
constexpr timespec operator+(const timespec &t1, const timespec &t2)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
Definition qdir.cpp:1819
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QJsonArray &)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QJsonArray &)
Q_CORE_EXPORT size_t qHash(const QJsonArray &array, size_t seed=0)
QList< QVariant > QVariantList
Definition qjsonarray.h:15
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLboolean r
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint first
GLfloat n
GLenum array
GLdouble GLdouble t
Definition qopenglext.h:243
bool operator>(const QPoint &a, const QPoint &b)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
ptrdiff_t qptrdiff
Definition qtypes.h:164
unsigned long long quint64
Definition qtypes.h:61
ptrdiff_t qsizetype
Definition qtypes.h:165
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:294
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:296
QList< int > list
[14]
QDataStream & operator<<(QDataStream &out, const MyClass &myObj)
[4]
QObject::connect nullptr
list prepend("one")
QSharedPointer< T > other(t)
[5]
this swap(other)
QGraphicsItem * item
QAction * at
QJSValueList args