forked from qt-creator/qt-creator
QmlDesigner: Fix JSObject
Change-Id: I108d5f1c0bf891f8229d4eb962f553f735e23e94 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -88,7 +88,7 @@ class JSObject : public QObject {
|
||||
Q_PROPERTY(bool currentParentIsRoot READ currentParentIsRoot NOTIFY modelNodeChanged)
|
||||
|
||||
public:
|
||||
JSObject();
|
||||
JSObject() = default;
|
||||
JSObject(QObject *parent = 0);
|
||||
void setModelNode(const ModelNode &node);
|
||||
bool hasParent() const;
|
||||
|
@@ -222,7 +222,7 @@ bool JSObject::isSubclassOf(const QString &typeName)
|
||||
NodeMetaInfo metaInfo = m_modelNode.metaInfo();
|
||||
|
||||
if (metaInfo.isValid())
|
||||
metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
return metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ bool JSObject::rootItemIsSubclassOf(const QString &typeName)
|
||||
NodeMetaInfo metaInfo = m_modelNode.view()->rootModelNode().metaInfo();
|
||||
|
||||
if (metaInfo.isValid())
|
||||
metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
return metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -243,16 +243,11 @@ bool JSObject::currentParentIsSubclassOf(const QString &typeName)
|
||||
&& m_modelNode.parentProperty().isValid()) {
|
||||
NodeMetaInfo metaInfo = m_modelNode.parentProperty().parentModelNode().metaInfo();
|
||||
if (metaInfo.isValid())
|
||||
metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
return metaInfo.isSubclassOf(typeName.toUtf8());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
JSObject::JSObject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} //Internal
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
Reference in New Issue
Block a user