Logo Search packages:      
Sourcecode: qt4-x11 version File versions

src_script_qscriptvalueiterator.cpp

//! [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]

Generated by  Doxygen 1.6.0   Back to index