forked from qt-creator/qt-creator
QmlDesigner: Remove instanceForModelNode functions
Use directly the NodeInstanceView Change-Id: I8e4da4fa9e130fe62db178df6a0b60e9bda01a86 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -58,9 +58,6 @@ public:
|
||||
|
||||
QmlItemNode rootQmlItemNode() const;
|
||||
|
||||
protected:
|
||||
NodeInstance instanceForModelNode(const ModelNode &modelNode);
|
||||
bool hasInstanceForModelNode(const ModelNode &modelNode);
|
||||
|
||||
void activateState(const QmlModelState &state);
|
||||
|
||||
|
@@ -70,7 +70,11 @@ QmlModelView* QmlModelNodeFacade::qmlModelView()
|
||||
|
||||
bool QmlModelNodeFacade::isValidQmlModelNodeFacade(const ModelNode &modelNode)
|
||||
{
|
||||
return modelNode.isValid() && qmlModelView() && qmlModelView()->nodeInstanceView() && qmlModelView()->hasInstanceForModelNode(modelNode) && qmlModelView()->instanceForModelNode(modelNode).isValid();
|
||||
return modelNode.isValid()
|
||||
&& qmlModelView()
|
||||
&& qmlModelView()->nodeInstanceView()
|
||||
&& qmlModelView()->nodeInstanceView()->hasInstanceForNode(modelNode)
|
||||
&& qmlModelView()->nodeInstanceView()->instanceForNode(modelNode).isValid();
|
||||
}
|
||||
|
||||
bool QmlModelNodeFacade::isRootNode() const
|
||||
|
@@ -85,14 +85,4 @@ QmlItemNode QmlModelView::rootQmlItemNode() const
|
||||
return QmlItemNode(rootModelNode());
|
||||
}
|
||||
|
||||
NodeInstance QmlModelView::instanceForModelNode(const ModelNode &modelNode)
|
||||
{
|
||||
return nodeInstanceView()->instanceForNode(modelNode);
|
||||
}
|
||||
|
||||
bool QmlModelView::hasInstanceForModelNode(const ModelNode &modelNode)
|
||||
{
|
||||
return nodeInstanceView() && nodeInstanceView()->hasInstanceForNode(modelNode);
|
||||
}
|
||||
|
||||
} //QmlDesigner
|
||||
|
@@ -403,11 +403,8 @@ bool QmlObjectNode::isAncestorOf(const QmlObjectNode &objectNode) const
|
||||
|
||||
QVariant QmlObjectNode::instanceValue(const ModelNode &modelNode, const PropertyName &name)
|
||||
{
|
||||
QmlModelView *modelView = qobject_cast<QmlModelView*>(modelNode.view());
|
||||
if (!modelView)
|
||||
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
|
||||
Q_ASSERT(modelView->hasInstanceForModelNode(modelNode));
|
||||
return modelView->instanceForModelNode(modelNode).property(name);
|
||||
Q_ASSERT(modelNode.view()->nodeInstanceView()->hasInstanceForNode(modelNode));
|
||||
return modelNode.view()->nodeInstanceView()->instanceForNode(modelNode).property(name);
|
||||
}
|
||||
|
||||
QString QmlObjectNode::generateTranslatableText(const QString &text)
|
||||
|
Reference in New Issue
Block a user