diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-21 05:39:26 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-21 05:39:26 (GMT) |
commit | 83061800dfe279dbd88ee1ef5ce17d213b156ecf (patch) | |
tree | 8e71e0807b093a3d96d6c0a2b4515d75af15d270 /src/declarative/qml/qmlengine.cpp | |
parent | b49f57e4a2071f3b825d3e60b05c5914f16bd297 (diff) | |
parent | c1a241652c587e6da92bf853608aed37938e1e48 (diff) | |
download | Qt-83061800dfe279dbd88ee1ef5ce17d213b156ecf.zip Qt-83061800dfe279dbd88ee1ef5ce17d213b156ecf.tar.gz Qt-83061800dfe279dbd88ee1ef5ce17d213b156ecf.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 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 7c0edf7..6361da4 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -666,7 +666,7 @@ QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt, Example (where targetItem is the id of an existing QML item): \code - newObject = createQmlObject('Rectangle {color: "red"; width: 20; height: 20}', + newObject = createQmlObject('import Qt 4.6; Rectangle {color: "red"; width: 20; height: 20}', targetItem, "dynamicSnippet1"); \endcode @@ -696,6 +696,8 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi QUrl url; if(ctxt->argumentCount() > 2) url = QUrl(ctxt->argument(2).toString()); + else + url = QUrl(QLatin1String("DynamicQML")); QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); QmlContext *qmlCtxt = qmlContext(parentArg); if (url.isEmpty()) { |