diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-22 05:34:41 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-22 05:36:35 (GMT) |
commit | 888d29c9c138ca3d698985f090ceb3db912ade0f (patch) | |
tree | aa991f683dd8e7ea4b05d029dd75b32321fde3c0 /src/declarative/qml/qdeclarativevme.cpp | |
parent | 42de973ff156383beed62a6b1bce70b56b360078 (diff) | |
download | Qt-888d29c9c138ca3d698985f090ceb3db912ade0f.zip Qt-888d29c9c138ca3d698985f090ceb3db912ade0f.tar.gz Qt-888d29c9c138ca3d698985f090ceb3db912ade0f.tar.bz2 |
Deprecate inline Script {} blocks
Inline blocks/includes have been replaced with an import syntax:
import "foo.js" as Foo
this gives better separation between QML and code. Imported script blocks
also have a mandatory qualifier, which leads to better optimization
potential.
Diffstat (limited to 'src/declarative/qml/qdeclarativevme.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index b3144a8..2338bc3 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -259,8 +259,9 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, case QDeclarativeInstruction::CreateComponent: { - QObject *qcomp = new QDeclarativeComponent(ctxt->engine, comp, ii + 1, instr.createComponent.count, - stack.isEmpty() ? 0 : stack.top()); + QDeclarativeComponent *qcomp = + new QDeclarativeComponent(ctxt->engine, comp, ii + 1, instr.createComponent.count, + stack.isEmpty() ? 0 : stack.top()); QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(qcomp, true); Q_ASSERT(ddata); @@ -275,6 +276,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, ddata->lineNumber = instr.line; ddata->columnNumber = instr.create.column; + QDeclarativeComponentPrivate::get(qcomp)->creationContext = ctxt; + stack.push(qcomp); ii += instr.createComponent.count; } @@ -581,6 +584,12 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, } break; + case QDeclarativeInstruction::StoreImportedScript: + { + ctxt->addImportedScript(scripts.at(instr.storeScript.value)); + } + break; + case QDeclarativeInstruction::StoreScriptString: { QObject *target = stack.top(); |