QmlDesigner: Properly resolve "dot properties" for dynamic objects

property NumberAnimation numberAnimation: NumberAnimation {
}

In this case this will expose the "dot properties" of numberAnimation.

Change-Id: I40aafcc4f762ab6297c0829674ac62d92cbd713d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2020-06-16 17:05:35 +02:00
parent f26c51d562
commit 3c5f3547fb

View File

@@ -88,12 +88,18 @@ static TypeName resolveTypeName(const ASTPropertyReference *ref, const ContextPt
if (ref->ast()->propertyToken.isValid()) { if (ref->ast()->propertyToken.isValid()) {
type = ref->ast()->memberType->name.toUtf8(); type = ref->ast()->memberType->name.toUtf8();
if (type == "alias") {
const Value *value = context->lookupReference(ref); const Value *value = context->lookupReference(ref);
if (!value) if (!value)
return type; return type;
if (const CppComponentValue * componentObjectValue = value->asCppComponentValue()) {
type = componentObjectValue->className().toUtf8();
dotProperties = getObjectTypes(componentObjectValue, context);
}
if (type == "alias") {
if (const ASTObjectValue * astObjectValue = value->asAstObjectValue()) { if (const ASTObjectValue * astObjectValue = value->asAstObjectValue()) {
if (astObjectValue->typeName()) { if (astObjectValue->typeName()) {
type = astObjectValue->typeName()->name.toUtf8(); type = astObjectValue->typeName()->name.toUtf8();