forked from qt-creator/qt-creator
QmlDesigner: Improve lookup for context senseitive help
Change-Id: Ic3cb05dd639548a81c1b45f35e2ee32348e54dcc Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
095b1a22fe
commit
388bfa22a8
@@ -36,6 +36,7 @@
|
|||||||
#include "nodeinstanceview.h"
|
#include "nodeinstanceview.h"
|
||||||
#include <qmlstate.h>
|
#include <qmlstate.h>
|
||||||
|
|
||||||
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -435,7 +436,18 @@ QString AbstractView::contextHelpId() const
|
|||||||
QString helpId;
|
QString helpId;
|
||||||
|
|
||||||
if (hasSelectedModelNodes()) {
|
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;
|
return helpId;
|
||||||
|
Reference in New Issue
Block a user