diff options
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlcustomparser.cpp | 28 | ||||
-rw-r--r-- | src/declarative/qml/qmlcustomparser_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser_p.h | 1 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qmlcustomparser.cpp index e864df9..a60f783 100644 --- a/src/declarative/qml/qmlcustomparser.cpp +++ b/src/declarative/qml/qmlcustomparser.cpp @@ -120,6 +120,7 @@ QmlCustomParserNodePrivate::fromObject(QmlParser::Object *root) return rootNode; } +#include <QtCore/qdebug.h> QmlCustomParserProperty QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p) { @@ -127,20 +128,23 @@ QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p) prop.d->name = p->name; prop.d->isList = (p->values.count() > 1); - for(int ii = 0; ii < p->values.count(); ++ii) { - Value *v = p->values.at(ii); + if (p->value) { + QmlCustomParserNode node = fromObject(p->value); + QList<QmlCustomParserProperty> props = node.properties(); + for (int ii = 0; ii < props.count(); ++ii) + prop.d->values << QVariant::fromValue(props.at(ii)); + } else { + for(int ii = 0; ii < p->values.count(); ++ii) { + Value *v = p->values.at(ii); + + if(v->object) { + QmlCustomParserNode node = fromObject(v->object); + prop.d->values << QVariant::fromValue(node); + } else { + prop.d->values << QVariant::fromValue(v->value); + } - // We skip fetched properties for now - if(v->object && v->object->type == -1) - continue; - - if(v->object) { - QmlCustomParserNode node = fromObject(v->object); - prop.d->values << QVariant::fromValue(node); - } else { - prop.d->values << QVariant::fromValue(v->primitive()); } - } return prop; diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h index e4e6089..fd780d6 100644 --- a/src/declarative/qml/qmlcustomparser_p.h +++ b/src/declarative/qml/qmlcustomparser_p.h @@ -65,6 +65,8 @@ public: QByteArray name() const; bool isList() const; + // Will be one of QmlParser::Variant, QmlCustomParserProperty or + // QmlCustomParserNode QList<QVariant> assignedValues() const; private: diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 5cc810e..95b21e6 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -272,6 +272,7 @@ namespace QmlParser void dump(int = 0) const; }; } +Q_DECLARE_METATYPE(QmlParser::Variant); QT_END_NAMESPACE |