summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index ead7ee5..64f0bac 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -203,7 +203,10 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
LocationSpan location,
AST::UiObjectInitializer *initializer)
{
- bool isType = !objectType.isEmpty() && objectType.at(0).isUpper() && !objectType.contains(QLatin1Char('.'));
+ int lastTypeDot = objectType.lastIndexOf(QLatin1Char('.'));
+ bool isType = !objectType.isEmpty() &&
+ (objectType.at(0).isUpper() |
+ lastTypeDot >= 0 && objectType.at(lastTypeDot+1).isUpper());
int propertyCount = 0;
for (; propertyName; propertyName = propertyName->next){
@@ -234,15 +237,21 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
return 0;
} else {
-
// Class
- const int typeId = _parser->findOrCreateTypeId(objectType);
+
+ QString resolvableObjectType = objectType;
+ if (lastTypeDot >= 0)
+ resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/'));
+ const int typeId = _parser->findOrCreateTypeId(resolvableObjectType);
Object *obj = new Object;
obj->type = typeId;
- _scope.append(objectType);
+
+ // XXX this doesn't do anything (_scope never builds up)
+ _scope.append(resolvableObjectType);
obj->typeName = qualifiedNameId().toLatin1();
_scope.removeLast();
+
obj->location = location;
if (propertyCount) {