QmlDesigner: Rename hasDefaultProperty to hasDefaultPropertyName

hasDefaultProperty sounded like the property existed in the model not
in the meta info system.

Change-Id: Iaa670f10b9d6d6038fbc3a4224250ed821407af4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-07-30 17:00:04 +02:00
parent 4d3c15f87b
commit 282de65774
5 changed files with 6 additions and 6 deletions

View File

@@ -113,7 +113,7 @@ static inline void reparentTo(const ModelNode &node, const QmlItemNode &parent)
if (parent.isValid() && node.isValid()) {
NodeAbstractProperty parentProperty;
if (parent.hasDefaultProperty())
if (parent.hasDefaultPropertyName())
parentProperty = parent.nodeAbstractProperty(parent.defaultPropertyName());
else
parentProperty = parent.nodeAbstractProperty("data");

View File

@@ -348,7 +348,7 @@ void MoveManipulator::reparentTo(FormEditorItem *newParent)
QmlItemNode parentItemNode(newParent->qmlItemNode());
if (parentItemNode.isValid()) {
if (parentItemNode.hasDefaultProperty())
if (parentItemNode.hasDefaultPropertyName())
parentProperty = parentItemNode.nodeAbstractProperty(parentItemNode.defaultPropertyName());
else
parentProperty = parentItemNode.nodeAbstractProperty("data");

View File

@@ -101,7 +101,7 @@ public:
bool isAncestorOf(const QmlObjectNode &objectNode) const;
bool hasDefaultProperty() const;
bool hasDefaultPropertyName() const;
PropertyName defaultPropertyName() const;
static QVariant instanceValue(const ModelNode &modelNode, const PropertyName &name);

View File

@@ -147,7 +147,7 @@ QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibrary
newQmlItemNode = createQmlItemNodeFromSource(view, itemLibraryEntry.qml(), position);
}
if (parentQmlItemNode.hasDefaultProperty())
if (parentQmlItemNode.hasDefaultPropertyName())
parentQmlItemNode.nodeAbstractProperty(parentQmlItemNode.defaultPropertyName()).reparentHere(newQmlItemNode);
if (!newQmlItemNode.isValid())

View File

@@ -517,7 +517,7 @@ QString QmlObjectNode::validId()
return modelNode().validId();
}
bool QmlObjectNode::hasDefaultProperty() const
bool QmlObjectNode::hasDefaultPropertyName() const
{
return modelNode().metaInfo().hasDefaultProperty();
}
@@ -529,7 +529,7 @@ PropertyName QmlObjectNode::defaultPropertyName() const
void QmlObjectNode::setParent(QmlObjectNode newParent)
{
if (newParent.hasDefaultProperty())
if (newParent.hasDefaultPropertyName())
newParent.modelNode().nodeAbstractProperty(newParent.defaultPropertyName()).reparentHere(modelNode());
}