summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-06-26 02:28:34 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-06-26 02:28:34 (GMT)
commitafa4e61b10187102d3ea49d1c11bae1ef919d94d (patch)
tree7890eb2f3194de2b9a2ca7ed6fd0227f7b92fa36 /src/declarative/qml
parentffc9e62cbf7e24cd04a1202de1b3e618f9e12642 (diff)
parent5b52c348243e6459cc7faa4ee76a23c7fadcd299 (diff)
downloadQt-afa4e61b10187102d3ea49d1c11bae1ef919d94d.zip
Qt-afa4e61b10187102d3ea49d1c11bae1ef919d94d.tar.gz
Qt-afa4e61b10187102d3ea49d1c11bae1ef919d94d.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp5
-rw-r--r--src/declarative/qml/qmlcomponent.cpp1
-rw-r--r--src/declarative/qml/qmldom.cpp10
-rw-r--r--src/declarative/qml/qmldom.h1
-rw-r--r--src/declarative/qml/qmlparser_p.h2
5 files changed, 18 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 8297ac4..cb0c571 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -570,7 +570,10 @@ void QmlCompiler::compileTree(Object *tree)
bool QmlCompiler::compileObject(Object *obj, const BindingContext &ctxt)
{
Q_ASSERT (obj->type != -1);
- obj->metatype = output->types.at(obj->type).metaObject();
+ const QmlCompiledData::TypeReference &tr = output->types.at(obj->type);
+ obj->metatype = tr.metaObject();
+ if (tr.component)
+ obj->url = tr.component->url();
if (output->types.at(obj->type).className == "Component") {
COMPILE_CHECK(compileComponent(obj, ctxt));
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index f90af4a..3429813 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -296,6 +296,7 @@ QmlComponent::QmlComponent(QmlEngine *engine, QmlCompiledComponent *cc, int star
cc->addref();
d->start = start;
d->count = count;
+ d->url = cc->url;
}
/*!
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index be58071..5271dc5 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -791,6 +791,16 @@ int QmlDomObject::length() const
return 0;
}
+// Returns the URL of the type, if it is an external type, or an empty URL if
+// not
+QUrl QmlDomObject::url() const
+{
+ if (d && d->object)
+ return d->object->url;
+ else
+ return QUrl();
+}
+
QmlDomBasicValuePrivate::QmlDomBasicValuePrivate()
: value(0)
{
diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h
index fde35a8..ab3e39f 100644
--- a/src/declarative/qml/qmldom.h
+++ b/src/declarative/qml/qmldom.h
@@ -143,6 +143,7 @@ public:
int position() const;
int length() const;
+ QUrl url() const;
private:
friend class QmlDomDocument;
friend class QmlDomComponent;
diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h
index a38ce69..78040da 100644
--- a/src/declarative/qml/qmlparser_p.h
+++ b/src/declarative/qml/qmlparser_p.h
@@ -102,6 +102,8 @@ namespace QmlParser
// QmlCompiledData::types array, or -1 if the object is a fetched
// object.
int type;
+ // The url of this object if it is an external type. Used by the DOM
+ QUrl url;
// The name of this type
QByteArray typeName;
// The id assigned to the object (if any).