Commit 388bfa22 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Thomas Hartmann

QmlDesigner: Improve lookup for context senseitive help

Change-Id: Ic3cb05dd639548a81c1b45f35e2ee32348e54dcc
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent 095b1a22
......@@ -36,6 +36,7 @@
#include "nodeinstanceview.h"
#include <qmlstate.h>
#include <coreplugin/helpmanager.h>
#include <utils/qtcassert.h>
namespace QmlDesigner {
......@@ -435,7 +436,18 @@ QString AbstractView::contextHelpId() const
QString helpId;
if (hasSelectedModelNodes()) {
helpId = QStringLiteral("QML.") + firstSelectedModelNode().simplifiedTypeName();
QString className = firstSelectedModelNode().simplifiedTypeName();
helpId = QStringLiteral("QML.") + className;
if (Core::HelpManager::linksForIdentifier(helpId).isEmpty() && firstSelectedModelNode().metaInfo().isValid()) {
foreach (className, firstSelectedModelNode().metaInfo().superClassNames()) {
helpId = QStringLiteral("QML.") + className;
if (Core::HelpManager::linksForIdentifier(helpId).isEmpty())
helpId = QString();
else
break;
}
}
}
return helpId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment