Commit 1d313aae authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: add instance meta info

parent ad09c0e4
......@@ -118,6 +118,7 @@ public:
double opacity() const;
QVariant property(const QString &name) const;
QVariant defaultValue(const QString &name) const;
QString instanceType(const QString &name) const;
bool isValid() const;
void makeInvalid();
......@@ -63,6 +63,7 @@ public:
NodeListProperty nodeListProperty(const QString &name) const;
QVariant instanceValue(const QString &name) const;
QString QmlObjectNode::instanceType(const QString &name) const;
bool hasProperty(const QString &name) const;
bool hasBindingProperty(const QString &name) const;
......@@ -427,6 +427,14 @@ QVariant NodeInstance::defaultValue(const QString &name) const
return m_nodeInstance->resetValue(name);
\brief Returns the type of the property of this NodeInstance.
QString NodeInstance::instanceType(const QString &name) const
return m_nodeInstance->instanceType(name);
\brief Returns if the NodeInstance is valid.
\returns true if the NodeInstance is valid
......@@ -617,6 +617,14 @@ QVariant ObjectNodeInstance::property(const QString &name) const
QString ObjectNodeInstance::instanceType(const QString &name) const
QDeclarativeProperty property(object(), name, context());
if (!property.isValid())
return QLatin1String("undefined");
return property.propertyTypeName();
void ObjectNodeInstance::setDeleteHeldInstance(bool deleteInstance)
......@@ -144,6 +144,7 @@ public:
virtual QVariant property(const QString &name) const;
virtual void resetProperty(const QString &name);
virtual void refreshProperty(const QString &name);
virtual QString instanceType(const QString &name) const;
void createDynamicProperty(const QString &name, const QString &typeName);
void setDeleteHeldInstance(bool deleteInstance);
......@@ -387,6 +387,11 @@ QVariant QmlObjectNode::instanceValue(const ModelNode &modelNode, const QString
return modelView->instanceForModelNode(modelNode).property(name);
QString QmlObjectNode::instanceType(const QString &name) const
return nodeInstance().instanceType(name);
NodeInstance QmlObjectNode::nodeInstance() const
return qmlModelView()->nodeInstanceView()->instanceForNode(modelNode());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment