diff options
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 6d49d3f..ffdfdf4 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -72,6 +72,7 @@ protected: using AST::Visitor::endVisit; virtual bool visit(AST::UiProgram *node); + virtual bool visit(AST::UiImport *node); virtual bool visit(AST::UiObjectDefinition *node); virtual bool visit(AST::UiPublicMember *node); virtual bool visit(AST::UiObjectBinding *node); @@ -240,6 +241,14 @@ bool ProcessAST::visit(AST::UiProgram *node) return false; } +// UiImport: T_IMPORT T_STRING_LITERAL ; +bool ProcessAST::visit(AST::UiImport *node) +{ + QString fileName = node->fileName->asString(); + _parser->addNamespacePath(fileName); + return false; +} + // UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression UiObjectInitializer ; bool ProcessAST::visit(AST::UiPublicMember *node) { @@ -616,5 +625,10 @@ void QmlScriptParser::setTree(Object *tree) root = tree; } +void QmlScriptParser::addNamespacePath(const QString &path) +{ + _nameSpacePaths.insertMulti(QString(), path); +} + QT_END_NAMESPACE |