forked from qt-creator/qt-creator
QmlDesigner: Share contextHelpId
Moved the code to AbstractView::contextHelpId so it can be shared. Change-Id: I0a95b5ee079cbc26c87d53587f7766f1c333a245 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -674,17 +674,10 @@ void DesignDocument::updateActiveQtVersion()
|
||||
|
||||
QString DesignDocument::contextHelpId() const
|
||||
{
|
||||
DesignDocumentView view;
|
||||
currentModel()->attachView(&view);
|
||||
if (view())
|
||||
view()->contextHelpId();
|
||||
|
||||
QList<ModelNode> nodes = view.selectedModelNodes();
|
||||
QString helpId;
|
||||
if (!nodes.isEmpty()) {
|
||||
helpId = nodes.first().type();
|
||||
helpId.replace("QtQuick", "QML");
|
||||
}
|
||||
|
||||
return helpId;
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
Reference in New Issue
Block a user