From 83a54916e9586836d6f8d8c64801f76c298e3b39 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 17 Jun 2025 15:48:10 +0300 Subject: [PATCH] QmlDesigner: Generalize property search for nested sections Effects aren't the only case of properties inside nested sections, so generalized the parent section visibility to not rely on specific property being set for the child section. Fixes: QDS-15579 Change-Id: I9e47e7669f8bdb9f3b6354ea54f99fa0bc18be37 Reviewed-by: Mahmoud Badri --- .../propertyEditorQmlSources/QtQuick/EffectsSection.qml | 6 ------ .../imports/HelperWidgets/PropertySearchBar.qml | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml index c566e2fd971..25d21a751a6 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml @@ -186,8 +186,6 @@ Section { spacing: 1 Section { - readonly property bool __isInEffectsSection: true // used by property search logic - sectionHeight: 37 anchors.left: parent.left anchors.right: parent.right @@ -235,8 +233,6 @@ Section { } Section { - readonly property bool __isInEffectsSection: true // used by property search logic - sectionHeight: 37 anchors.left: parent.left anchors.right: parent.right @@ -311,8 +307,6 @@ Section { Section { id: delegate - readonly property bool __isInEffectsSection: true // used by property search logic - property QtObject wrapper: modelNodeBackend.registerSubSelectionWrapper(modelData) property bool wasExpanded: false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertySearchBar.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertySearchBar.qml index 5a71bd8c851..2df62286e50 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertySearchBar.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertySearchBar.qml @@ -63,7 +63,7 @@ Rectangle { internal.clear(); const searchText = searchBox.text.toLowerCase(); if (searchText.length > 0) { - internal.traverse(root.contentItem, searchText); + internal.traverse(root.contentItem, searchText, false); internal.searched = true; } } @@ -98,7 +98,7 @@ Rectangle { }); } - function traverse(item, searchText) { + function traverse(item, searchText, isInSection) { let hideSection = true; let hideParentSection = true; item.children.forEach((child, index, arr) => { @@ -135,13 +135,14 @@ Rectangle { } } } - hideSection &= internal.traverse(child, searchText); + hideSection &= internal.traverse(child, searchText, + isInSection || child instanceof HelperWidgets.Section); if (child instanceof HelperWidgets.Section) { const action = hideSection ? internal.enableSearchHideAction : internal.expandSectionAction; action(child); - if (child.__isInEffectsSection && !hideSection) + if (isInSection && !hideSection) hideParentSection = false; hideSection = true;