diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-27 02:58:21 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-27 02:58:52 (GMT) |
commit | b69864da59c42a09a3acc373eb77a85f8f8c93b2 (patch) | |
tree | bcf8e8b260831b898abbd3dd0e8dbd0b969b24d8 /src/declarative/qml | |
parent | ab7a0034af5f775fffc6003412bc895148181a87 (diff) | |
download | Qt-b69864da59c42a09a3acc373eb77a85f8f8c93b2.zip Qt-b69864da59c42a09a3acc373eb77a85f8f8c93b2.tar.gz Qt-b69864da59c42a09a3acc373eb77a85f8f8c93b2.tar.bz2 |
Disallow "Qt" as namespace import
This conflicts with the global object's "Qt" property.
QTBUG-10143
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativescriptparser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index e7c8a12..8b96733 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -449,6 +449,14 @@ bool ProcessAST::visit(AST::UiImport *node) _parser->_errors << error; return false; } + if (import.qualifier == QLatin1String("Qt")) { + QDeclarativeError error; + error.setDescription(QCoreApplication::translate("QDeclarativeParser","Reserved name \"Qt\" cannot be used as an qualifier")); + error.setLine(node->importIdToken.startLine); + error.setColumn(node->importIdToken.startColumn); + _parser->_errors << error; + return false; + } // Check for script qualifier clashes bool isScript = import.type == QDeclarativeScriptParser::Import::Script; |