From 4ad8890b885b88a2b4fd670076c4d77f20708590 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 28 Oct 2021 17:21:39 +0200 Subject: [PATCH] QmlDesigner: Use AuxiliaryData as cache for NodeHints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Evaluating the NodeHints can become a bottle-neck in large scenes. The columnCount depends on the filter and is called many times during painting. For large scenes with many nodes this becomes a real bottle-neck turning QDS unusable. Task-number: QDS-5277 Change-Id: Ifbd9ec8024e30541bfaafba4c44db47f5c426bfc Reviewed-by: Henning Gründl --- .../components/navigator/navigatortreemodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index e07f300bffc..aa04d232876 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -316,7 +316,12 @@ QList filteredList(const NodeListProperty &property, bool filter, boo if (filter) { list.append(Utils::filtered(property.toModelNodeList(), [] (const ModelNode &arg) { - return QmlItemNode::isValidQmlItemNode(arg) || NodeHints::fromModelNode(arg).visibleInNavigator(); + const char auxProp[] = "showInNavigator@Internal"; + if (arg.hasAuxiliaryData(auxProp)) + return arg.auxiliaryData(auxProp).toBool(); + const bool value = QmlItemNode::isValidQmlItemNode(arg) || NodeHints::fromModelNode(arg).visibleInNavigator(); + arg.setAuxiliaryData(auxProp, value); + return value; })); } else { list = property.toModelNodeList();