summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@nokia.com>2011-11-10 11:55:05 +0100
committerJarek Kobus <jaroslaw.kobus@nokia.com>2011-11-10 16:55:11 +0100
commitda14d8610497ea5a272fae715efa18fc8643b9d7 (patch)
tree99c3b8189404d6405e7162c6edcadb904372055e /src/plugins/texteditor
parent8fcb4d808415eab5f9b02fa448b03dff60191d9a (diff)
downloadqt-creator-da14d8610497ea5a272fae715efa18fc8643b9d7.tar.gz
Implement context help for pro file editor
Task-number: QTCREATORBUG-6325 Change-Id: Ie8b2eb582eb527eac6af56d0c69a8ae1dafdc1df Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r--src/plugins/texteditor/basehoverhandler.cpp2
-rw-r--r--src/plugins/texteditor/basehoverhandler.h2
-rw-r--r--src/plugins/texteditor/helpitem.cpp11
-rw-r--r--src/plugins/texteditor/helpitem.h1
4 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp
index 0a41dced8d..ae18e63b3b 100644
--- a/src/plugins/texteditor/basehoverhandler.cpp
+++ b/src/plugins/texteditor/basehoverhandler.cpp
@@ -157,8 +157,8 @@ void BaseHoverHandler::decorateToolTip()
if (!contents.isEmpty()) {
setToolTip(Qt::escape(toolTip()));
appendToolTip(contents);
+ addF1ToToolTip();
}
- addF1ToToolTip();
}
}
diff --git a/src/plugins/texteditor/basehoverhandler.h b/src/plugins/texteditor/basehoverhandler.h
index d2cbeacef1..74c76d3798 100644
--- a/src/plugins/texteditor/basehoverhandler.h
+++ b/src/plugins/texteditor/basehoverhandler.h
@@ -61,8 +61,6 @@ public:
private slots:
void editorOpened(Core::IEditor *editor);
-
-public slots:
void showToolTip(TextEditor::ITextEditor *editor, const QPoint &point, int pos);
void updateContextHelpId(TextEditor::ITextEditor *editor, int pos);
diff --git a/src/plugins/texteditor/helpitem.cpp b/src/plugins/texteditor/helpitem.cpp
index af20367bf1..022d2eb59c 100644
--- a/src/plugins/texteditor/helpitem.cpp
+++ b/src/plugins/texteditor/helpitem.cpp
@@ -77,6 +77,8 @@ bool HelpItem::isValid() const
{
if (!Core::HelpManager::instance()->linksForIdentifier(m_helpId).isEmpty())
return true;
+ if (QUrl(m_helpId).isValid())
+ return true;
return false;
}
@@ -90,6 +92,12 @@ QString HelpItem::extractContent(bool extended) const
QString contents;
QMap<QString, QUrl> helpLinks = Core::HelpManager::instance()->linksForIdentifier(m_helpId);
+ if (helpLinks.isEmpty()) {
+ // Maybe this is already an URL...
+ QUrl url(m_helpId);
+ if (url.isValid())
+ helpLinks.insert(m_helpId, m_helpId);
+ }
foreach (const QUrl &url, helpLinks) {
const QByteArray &html = Core::HelpManager::instance()->fileData(url);
switch (m_category) {
@@ -117,6 +125,9 @@ QString HelpItem::extractContent(bool extended) const
case QmlProperty:
contents = htmlExtractor.getQmlPropertyDescription(html, m_docMark);
break;
+ case QMakeVariableOfFunction:
+ contents = htmlExtractor.getQMakeVariableOrFunctionDescription(html, m_docMark);
+ break;
default:
break;
diff --git a/src/plugins/texteditor/helpitem.h b/src/plugins/texteditor/helpitem.h
index 0be6b7dc95..9f034165cf 100644
--- a/src/plugins/texteditor/helpitem.h
+++ b/src/plugins/texteditor/helpitem.h
@@ -51,6 +51,7 @@ public:
Function,
QmlComponent,
QmlProperty,
+ QMakeVariableOfFunction,
Unknown
};