Commit 3e1234c8 authored by Tim Jenssen's avatar Tim Jenssen Committed by Thomas Hartmann

QmlDesigner: disable none default properties in navigator

Change-Id: Ia5c6e4c34ef40145f0fa7618a1ceb5afb1f666b3
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 76fbc65c
......@@ -50,6 +50,8 @@
#include <QtDebug>
#define DISABLE_VISIBLE_PROPERTIES
namespace QmlDesigner {
static PropertyNameList visibleProperties(const ModelNode &node)
......@@ -84,7 +86,9 @@ 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));
......@@ -201,7 +205,9 @@ static bool computeTarget(const QModelIndex &rowModelIndex,
ModelNode targetNode = navigatorTreeModel->nodeForIndex(targetItemIndex);
if (!targetNode.metaInfo().hasDefaultProperty())
return false;
#ifndef DISABLE_VISIBLE_PROPERTIES
*targetRowNumber -= visibleProperties(targetNode).count();
#endif
targetPropertyName = targetNode.metaInfo().defaultPropertyName();
} else {
targetItemIndex = rowModelIndex.parent();
......@@ -280,6 +286,7 @@ ItemRow NavigatorTreeModel::createItemRow(const ModelNode &node)
visibilityItem->setCheckable(false);
QMap<QString, QStandardItem *> propertyItems;
#ifndef DISABLE_VISIBLE_PROPERTIES
foreach (const QString &propertyName, visibleProperties(node)) {
QStandardItem *propertyItem = new QStandardItem;
propertyItem->setSelectable(false);
......@@ -290,6 +297,7 @@ ItemRow NavigatorTreeModel::createItemRow(const ModelNode &node)
propertyItems.insert(propertyName, propertyItem);
idItem->appendRow(propertyItem);
}
#endif
# ifdef _LOCK_ITEMS_
ItemRow newRow = ItemRow(idItem, lockItem, visibilityItem, propertyItems);
......@@ -340,7 +348,9 @@ static void findTargetItem(const NodeListProperty &listProperty,
*targetItem = parentRow.propertyItems.value(listProperty.name());
} else { // default property
*targetItem = parentRow.idItem;
#ifndef DISABLE_VISIBLE_PROPERTIES
newRowNumber += visibleProperties(listProperty.parentModelNode()).count();
#endif
}
} else {
*targetItem = currentItemRow.idItem->parent();
......
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