forked from qt-creator/qt-creator
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:
committed by
Thomas Hartmann
parent
fbcb45c105
commit
4ad8890b88
@@ -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();
|
||||
|
Reference in New Issue
Block a user