diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-05 20:05:18 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-05 20:05:18 (GMT) |
commit | 7e423cbaba0eb0a7d1e7c81b673149ba59901aab (patch) | |
tree | 90fc6cb660e99575f31ab234788cd1869e2d8e39 /src/declarative/qml/qdeclarativeengine.cpp | |
parent | 6f44e508d421f69f6f61db567c29aa3eb4828f96 (diff) | |
parent | 591807899deb3fc479bd32722756f74b899977d5 (diff) | |
download | Qt-7e423cbaba0eb0a7d1e7c81b673149ba59901aab.zip Qt-7e423cbaba0eb0a7d1e7c81b673149ba59901aab.tar.gz Qt-7e423cbaba0eb0a7d1e7c81b673149ba59901aab.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/declarative/qml/qdeclarativeengine.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index cffded3..9ca7858 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -207,7 +207,7 @@ For example: import QtQuick 1.0 Text { - color: Qt.rgba(255, 0, 0, 1) + color: Qt.rgba(1, 0, 0, 1) text: Qt.md5("hello, world") } \endqml @@ -284,9 +284,11 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url) { if (p) { - QDeclarativeContextData *ctxt = QDeclarativeEnginePrivate::get(this)->getContext(context); - Q_ASSERT(ctxt); - return ctxt->resolvedUrl(url); + QDeclarativeContextData *ctxt = p->getContext(context); + if (ctxt) + return ctxt->resolvedUrl(url); + else + return p->getUrl(context).resolved(url); } return baseUrl.resolved(url); } @@ -1146,12 +1148,8 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS QString arg = ctxt->argument(0).toString(); if (arg.isEmpty()) return engine->nullValue(); - QUrl url; + QUrl url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt, QUrl(arg)); QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt); - if (context) - url = QUrl(context->resolvedUrl(QUrl(arg))); - else - url = activeEnginePriv->getUrl(ctxt).resolved(QUrl(arg)); QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine); QDeclarativeComponentPrivate::get(c)->creationContext = context; QDeclarativeData::get(c, true)->setImplicitDestructible(); @@ -1635,7 +1633,7 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc return QScriptValue(e, false); bool ret = false; #ifndef QT_NO_DESKTOPSERVICES - ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString())); + ret = QDesktopServices::openUrl(QDeclarativeScriptEngine::get(e)->resolvedUrl(ctxt, QUrl(ctxt->argument(0).toString()))); #endif return QScriptValue(e, ret); } |