forked from qt-creator/qt-creator
QmlDesigner: Add hints to hide node in navigator
For effects we want to explcitly hide certain items. This patch ignores adjustments for project storage. Change-Id: I49748f851453c7c8d5001ca696d5a6b1b2969666 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -320,7 +320,10 @@ QList<ModelNode> NavigatorTreeModel::filteredList(const NodeListProperty &proper
|
||||
|
||||
if (filter) {
|
||||
list.append(::Utils::filtered(nameFilteredList, [](const ModelNode &arg) {
|
||||
const bool value = (QmlItemNode::isValidQmlItemNode(arg) || NodeHints::fromModelNode(arg).visibleInNavigator())
|
||||
const bool visibleInNavigator = NodeHints::fromModelNode(arg).visibleInNavigator();
|
||||
const bool hideInNavigator = NodeHints::fromModelNode(arg).hideInNavigator();
|
||||
const bool value = ((QmlItemNode::isValidQmlItemNode(arg) && !hideInNavigator)
|
||||
|| visibleInNavigator)
|
||||
&& arg.id() != Constants::MATERIAL_LIB_ID;
|
||||
return value;
|
||||
}));
|
||||
|
@@ -47,6 +47,7 @@ public:
|
||||
QStringList visibleNonDefaultProperties() const;
|
||||
bool takesOverRenderingOfChildren() const;
|
||||
bool visibleInNavigator() const;
|
||||
bool hideInNavigator() const;
|
||||
bool visibleInLibrary() const;
|
||||
QString forceNonDefaultProperty() const;
|
||||
QPair<QString, QVariant> setParentProperty() const;
|
||||
|
@@ -320,6 +320,14 @@ bool NodeHints::visibleInNavigator() const
|
||||
return evaluateBooleanExpression("visibleInNavigator", false);
|
||||
}
|
||||
|
||||
bool NodeHints::hideInNavigator() const
|
||||
{
|
||||
if (!isValid())
|
||||
return false;
|
||||
|
||||
return evaluateBooleanExpression("hideInNavigator", false);
|
||||
}
|
||||
|
||||
bool NodeHints::visibleInLibrary() const
|
||||
{
|
||||
auto flagIs = m_modelNode.metaInfo().visibleInLibrary();
|
||||
|
Reference in New Issue
Block a user