Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_script_qjsvalueiterator.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
//! [0]
5
QJSValue
object
;
6
...
7
QJSValueIterator
it(object);
8
while
(it.hasNext()) {
9
it.next();
10
qDebug() << it.name() <<
": "
<< it.value().toString();
11
}
12
//! [0]
13
14
15
//! [1]
16
QJSValue
obj
= ...;
// the object to iterate over
17
while
(obj.isObject()) {
18
QJSValueIterator it(obj);
19
while
(it.hasNext()) {
20
it.next();
21
qDebug() << it.name();
22
}
23
obj = obj.prototype();
24
}
25
//! [1]
QJSValueIterator
The QJSValueIterator class provides a Java-style iterator for QJSValue.
Definition
qjsvalueiterator.h:18
object
CallableWithState object
Definition
src_concurrent_qtconcurrenttask.cpp:65
obj
QJSValue obj
[0]
Definition
src_script_qjsvalueiterator.cpp:16
qtdeclarative
src
qml
doc
snippets
code
src_script_qjsvalueiterator.cpp
Generated on
for Qt by
1.14.0