blob: c9de60270adecdede7cfe8c979813aee5905216d (
plain)
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
|
//! [0]
QScriptValue object;
...
QScriptValueIterator it(object);
while (it.hasNext()) {
it.next();
qDebug() << it.name() << ": " << it.value().toString();
}
//! [0]
//! [1]
QScriptValue obj = ...; // the object to iterate over
while (obj.isObject()) {
QScriptValueIterator it(obj);
while (it.hasNext()) {
it.next();
qDebug() << it.name();
}
obj = obj.prototype();
}
//! [1]
//! [2]
while (it.hasNext()) {
it.next();
if (it.flags() & QScriptValue::SkipInEnumeration)
continue;
qDebug() << "found enumerated property:" << it.name();
}
//! [2]
|