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>
This commit is contained in:
Thomas Hartmann
2021-10-28 17:21:39 +02:00
committed by Thomas Hartmann
parent fbcb45c105
commit 4ad8890b88

View File

@@ -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();