summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-27 02:58:21 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-27 02:58:52 (GMT)
commitb69864da59c42a09a3acc373eb77a85f8f8c93b2 (patch)
treebcf8e8b260831b898abbd3dd0e8dbd0b969b24d8 /src/declarative/qml
parentab7a0034af5f775fffc6003412bc895148181a87 (diff)
downloadQt-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.cpp8
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;