Commit 6e8e660f authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Some cleanup

This was just some reference/leftover. It is now used
in the WIP implementation of the new/alternate model.

Change-Id: I2909f3b7c24121277b1b05b03716d0a2dbdbcd73
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 7a9f3d9d
......@@ -54,36 +54,8 @@
#include <QtDebug>
#define DISABLE_VISIBLE_PROPERTIES
namespace QmlDesigner {
#ifndef DISABLE_VISIBLE_PROPERTIES
static PropertyNameList visibleProperties(const ModelNode &node)
{
PropertyNameList propertyList;
foreach (const PropertyName &propertyName, node.metaInfo().propertyNames()) {
if (!propertyName.contains('.') //do not show any dot properties, since they are tricky and unlikely to make sense
&& node.metaInfo().propertyIsWritable(propertyName)
&& propertyName != "parent"
&& node.metaInfo().propertyTypeName(propertyName) != TypeName("Component")
&& !node.metaInfo().propertyIsEnumType(propertyName) //Some enums have the same name as Qml types (e. g. Flow)
&& !node.metaInfo().propertyIsPrivate(propertyName) //Do not show private properties
&& propertyName != node.metaInfo().defaultPropertyName()) { // TODO: ask the node instances
TypeName qmlType = node.metaInfo().propertyTypeName(propertyName);
if (node.model()->metaInfo(qmlType).isValid() &&
node.model()->metaInfo(qmlType).isSubclassOf("QtQuick.Item", -1, -1)) {
propertyList.append(propertyName);
}
}
}
return propertyList;
}
#endif
static QList<ModelNode> acceptedModelNodeChildren(const ModelNode &parentNode)
{
QList<ModelNode> children;
......@@ -92,10 +64,6 @@ static QList<ModelNode> acceptedModelNodeChildren(const ModelNode &parentNode)
if (parentNode.metaInfo().hasDefaultProperty())
properties.append(parentNode.metaInfo().defaultPropertyName());
#ifndef DISABLE_VISIBLE_PROPERTIES
properties.append(visibleProperties(parentNode));
#endif
foreach (const PropertyName &propertyName, properties) {
AbstractProperty property(parentNode.property(propertyName));
if (property.isNodeAbstractProperty())
......
Markdown is supported
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