From 4ad8890b885b88a2b4fd670076c4d77f20708590 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 28 Oct 2021 17:21:39 +0200 Subject: [PATCH 1/2] 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(); From 38af447ee061932a31b654efd4cba9c713993c4a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 29 Oct 2021 15:57:36 +0200 Subject: [PATCH 2/2] Fix context help for e.g. CMake CMake documentation links do not have Qt's version style. So, if our try to find "the highest version" fails, we still need to provide the link to open. Amends 128c7dfbefb71523c064c0c221797d4f35a42213 Fixes: QTCREATORBUG-26455 Change-Id: I3e7588cac5d4ef8ee912b3f5511e63da0b8a0f52 Reviewed-by: Jarek Kobus --- src/plugins/coreplugin/helpitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/helpitem.cpp b/src/plugins/coreplugin/helpitem.cpp index 50f84bbf7ab..c2cb6ac54ef 100644 --- a/src/plugins/coreplugin/helpitem.cpp +++ b/src/plugins/coreplugin/helpitem.cpp @@ -298,7 +298,8 @@ static const HelpItem::Links getBestLink(const HelpItem::Links &links) // documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look // different. QVersionNumber highestVersion; - HelpItem::Link bestLink; + // Default to first link if version extraction failed, possibly because it is not a Qt doc link + HelpItem::Link bestLink = links.front(); for (const HelpItem::Link &link : links) { const QVersionNumber version = extractVersion(link.second).second; if (version > highestVersion) {