Context Help support for Bauhaus

Task-number: BAUHAUS-451
Reviewed-by: kkoehne
This commit is contained in:
Lasse Holmstedt
2010-03-08 09:47:45 +01:00
parent 1b5bc65645
commit 736963a422
6 changed files with 40 additions and 4 deletions

View File

@@ -416,7 +416,7 @@ void DesignDocumentController::loadCurrentModel()
m_d->model->attachView(m_d->navigator.data());
m_d->itemLibrary->setMetaInfo(m_d->model->metaInfo());
if (m_d->formEditorView .isNull()) {
if (m_d->formEditorView.isNull()) {
m_d->formEditorView = new FormEditorView(this);
m_d->stackedWidget->addWidget(m_d->formEditorView->widget());
ComponentAction *componentAction = new ComponentAction(m_d->formEditorView->widget());
@@ -857,4 +857,19 @@ bool DesignDocumentController::save(QIODevice *device, QString * /*errorMessage*
}
}
QString DesignDocumentController::contextHelpId() const
{
DesignDocumentControllerView view;
m_d->model->attachView(&view);
QList<ModelNode> nodes = view.selectedModelNodes();
QString helpId;
if (!nodes.isEmpty()) {
helpId = nodes.first().type();
helpId.replace("Qt/", "QML.");
}
return helpId;
}
} // namespace QmlDesigner