The second document snippet won't work anymore since the equivalent
of QScriptValue::PropertyFlag doesn't exist. It is thus removed.
Change-Id: Ib8fadef6c6aec4bc257cc245bb58948f64b69945
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
****************************************************************************/
//! [0]
-QScriptValue object;
+QJSValue object;
...
-QScriptValueIterator it(object);
+QJSValueIterator it(object);
while (it.hasNext()) {
it.next();
qDebug() << it.name() << ": " << it.value().toString();
//! [1]
-QScriptValue obj = ...; // the object to iterate over
+QJSValue obj = ...; // the object to iterate over
while (obj.isObject()) {
- QScriptValueIterator it(obj);
+ QJSValueIterator it(obj);
while (it.hasNext()) {
it.next();
qDebug() << it.name();
}
//! [1]
-
-//! [2]
-while (it.hasNext()) {
- it.next();
- if (it.flags() & QScriptValue::SkipInEnumeration)
- continue;
- qDebug() << "found enumerated property:" << it.name();
-}
-//! [2]
\snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 1
- Note that QJSValueIterator will not automatically skip over
- properties that have the QJSValue::SkipInEnumeration flag set;
- that flag only affects iteration in script code. If you want, you
- can skip over such properties with code like the following:
-
- \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 2
-
\sa QJSValue::property()
*/