QmlDesigner: QtObject is in QML now

If a type cannot be created we created a QtObject instead.
Since we create Item for items this crash was rare.

Task-number: QDS-8460
Change-Id: Ifd80f6670bec5328ddd122e0f2f2c133c487b3bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2022-12-02 15:52:55 +01:00
parent 728605b2ae
commit a86cb74526

View File

@@ -285,7 +285,15 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
if (object == nullptr)
object = new QQuickItem;
} else {
object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject", 2, 0, nodeInstanceServer->context());
object = Internal::ObjectNodeInstance::createPrimitive("QML/QtObject",
1,
0,
nodeInstanceServer->context());
if (object == nullptr) //Fallback for Qt 5
object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject",
2,
0,
nodeInstanceServer->context());
}
}