QmlDesigner: Fix JSObject

Change-Id: I108d5f1c0bf891f8229d4eb962f553f735e23e94
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tobias Hunger
2016-11-29 14:53:27 +01:00
parent 236ce87696
commit f650b17d23
2 changed files with 4 additions and 9 deletions

View File

@@ -88,7 +88,7 @@ class JSObject : public QObject {
Q_PROPERTY(bool currentParentIsRoot READ currentParentIsRoot NOTIFY modelNodeChanged) Q_PROPERTY(bool currentParentIsRoot READ currentParentIsRoot NOTIFY modelNodeChanged)
public: public:
JSObject(); JSObject() = default;
JSObject(QObject *parent = 0); JSObject(QObject *parent = 0);
void setModelNode(const ModelNode &node); void setModelNode(const ModelNode &node);
bool hasParent() const; bool hasParent() const;

View File

@@ -222,7 +222,7 @@ bool JSObject::isSubclassOf(const QString &typeName)
NodeMetaInfo metaInfo = m_modelNode.metaInfo(); NodeMetaInfo metaInfo = m_modelNode.metaInfo();
if (metaInfo.isValid()) if (metaInfo.isValid())
metaInfo.isSubclassOf(typeName.toUtf8()); return metaInfo.isSubclassOf(typeName.toUtf8());
return false; return false;
} }
@@ -232,7 +232,7 @@ bool JSObject::rootItemIsSubclassOf(const QString &typeName)
NodeMetaInfo metaInfo = m_modelNode.view()->rootModelNode().metaInfo(); NodeMetaInfo metaInfo = m_modelNode.view()->rootModelNode().metaInfo();
if (metaInfo.isValid()) if (metaInfo.isValid())
metaInfo.isSubclassOf(typeName.toUtf8()); return metaInfo.isSubclassOf(typeName.toUtf8());
return false; return false;
} }
@@ -243,16 +243,11 @@ bool JSObject::currentParentIsSubclassOf(const QString &typeName)
&& m_modelNode.parentProperty().isValid()) { && m_modelNode.parentProperty().isValid()) {
NodeMetaInfo metaInfo = m_modelNode.parentProperty().parentModelNode().metaInfo(); NodeMetaInfo metaInfo = m_modelNode.parentProperty().parentModelNode().metaInfo();
if (metaInfo.isValid()) if (metaInfo.isValid())
metaInfo.isSubclassOf(typeName.toUtf8()); return metaInfo.isSubclassOf(typeName.toUtf8());
} }
return false; return false;
} }
JSObject::JSObject()
{
}
} //Internal } //Internal
} // namespace QmlDesigner } // namespace QmlDesigner