diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-23 02:07:35 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-23 02:07:35 (GMT) |
commit | dd61bcbafd669d77a35d2161880ba915f78bf240 (patch) | |
tree | e7e3b8cc1725dde557c66e23cfc7be4b996150e8 /src/declarative/qml/qmlengine.cpp | |
parent | 6f43de5c1173277465f13eed9e904928a54bb9fc (diff) | |
parent | af965934e6dbf8f581b1f9e241a08a9b2128472a (diff) | |
download | Qt-dd61bcbafd669d77a35d2161880ba915f78bf240.zip Qt-dd61bcbafd669d77a35d2161880ba915f78bf240.tar.gz Qt-dd61bcbafd669d77a35d2161880ba915f78bf240.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 75ff284..6549e5c 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -71,6 +71,7 @@ #include <QtCore/qcoreapplication.h> #include <QtCore/qdir.h> #include <qmlcomponent.h> +#include <qmlbindablecomponent.h> #include "private/qmlmetaproperty_p.h" #include <private/qmlbinding_p.h> #include <private/qmlvme_p.h> @@ -601,19 +602,20 @@ QScriptValue QmlEngine::qmlScriptObject(QObject* object, QmlEngine* engine) */ QScriptValue QmlEngine::createComponent(QScriptContext *ctxt, QScriptEngine *engine) { - QmlComponent* c; + QmlBindableComponent* c; QmlEngine* activeEngine = qobject_cast<QmlEngine*>( engine->globalObject().property(QLatin1String("qmlEngine")).toQObject()); + QmlContext* context =activeEngine->d_func()->currentExpression->context(); if(ctxt->argumentCount() != 1 || !activeEngine){ - c = new QmlComponent(activeEngine); + c = new QmlBindableComponent(activeEngine); }else{ - QUrl url = QUrl(activeEngine->d_func()->currentExpression->context() - ->resolvedUrl(ctxt->argument(0).toString())); + QUrl url = QUrl(context->resolvedUrl(ctxt->argument(0).toString())); if(!url.isValid()){ url = QUrl(ctxt->argument(0).toString()); } - c = new QmlComponent(activeEngine, url, activeEngine); + c = new QmlBindableComponent(activeEngine, url, activeEngine); } + c->setContext(context); return engine->newQObject(c); } |