forked from qt-creator/qt-creator
QmlDesigner.instances: allow fallback to item
If we know from the (text editor) meta system that an object is an (visible) item, we always create an item as fallback. We might not be able to instaciate the original item. Change-Id: I6851cd7a8de68d9d09b789927c204f0617017de7 Reviewed-on: http://codereview.qt.nokia.com/829 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
This commit is contained in:
committed by
Marco Bubke
parent
5d87d4c49b
commit
08e4b339f1
@@ -218,6 +218,13 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
|
||||
object = Internal::ObjectNodeInstance::createPrimitive(instanceContainer.type(), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context());
|
||||
}
|
||||
|
||||
if ((object == 0) && (instanceContainer.metaType() == InstanceContainer::ItemMetaType)) //If we cannot instanciate the object but we know it has to be an Ttem, we create an Item instead.
|
||||
#if QT_VERSION >= 0x050000
|
||||
object = Internal::ObjectNodeInstance::createPrimitive("QSGItem", 2, 0, nodeInstanceServer->context())
|
||||
#else
|
||||
object = Internal::ObjectNodeInstance::createPrimitive("QDeclarativeItem", 2, 0, nodeInstanceServer->context());
|
||||
#endif
|
||||
|
||||
ServerNodeInstance instance(createInstance(object));
|
||||
|
||||
instance.internalInstance()->setNodeInstanceServer(nodeInstanceServer);
|
||||
|
||||
Reference in New Issue
Block a user