aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@qt.io>2021-10-28 17:21:39 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2021-10-28 19:00:23 +0000
commit4ad8890b885b88a2b4fd670076c4d77f20708590 (patch)
tree8336a6d2833ad0649432265e612270c05e8703c1
parentfbcb45c105b7e8aec5eab382c05774448c1e6e13 (diff)
QmlDesigner: Use AuxiliaryData as cache for NodeHints
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 <henning.gruendl@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index e07f300bff..aa04d23287 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -316,7 +316,12 @@ QList<ModelNode> 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();