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]
6...
7QJSValueIterator it(object);
8while (it.hasNext()) {
9 it.next();
10 qDebug() << it.name() << ": " << it.value().toString();
11}
12//! [0]
13
14
15//! [1]
16QJSValue obj = ...; // the object to iterate over
17while (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]
The QJSValueIterator class provides a Java-style iterator for QJSValue.
CallableWithState object
QJSValue obj
[0]