forked from qt-creator/qt-creator
Help: Improve handling of results from index lookup
If help is only found by looking up in the index, show a selection
dialog to the user even if there is only one result. Otherwise we create
the impression that we really think that the help we find is the correct
one.
Also do not add the help text to the tool tip in this case.
Test case: struct Foo { static void objectCreated() {} };
Change-Id: I9579302843ea2923e06f56f4b646dd101f183b3f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -84,10 +84,9 @@ public:
|
|||||||
const Links &links() const;
|
const Links &links() const;
|
||||||
const Links bestLinks() const;
|
const Links bestLinks() const;
|
||||||
const QString keyword() const;
|
const QString keyword() const;
|
||||||
|
|
||||||
private:
|
|
||||||
bool isFuzzyMatch() const;
|
bool isFuzzyMatch() const;
|
||||||
|
|
||||||
|
private:
|
||||||
QUrl m_helpUrl;
|
QUrl m_helpUrl;
|
||||||
QStringList m_helpIds;
|
QStringList m_helpIds;
|
||||||
QString m_docMark;
|
QString m_docMark;
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ void HelpPluginPrivate::showContextHelp(const HelpItem &contextHelp)
|
|||||||
.arg(contextHelp.helpIds().join(", "))
|
.arg(contextHelp.helpIds().join(", "))
|
||||||
.arg(HelpPlugin::tr("No documentation available.")));
|
.arg(HelpPlugin::tr("No documentation available.")));
|
||||||
}
|
}
|
||||||
} else if (links.size() == 1) {
|
} else if (links.size() == 1 && !contextHelp.isFuzzyMatch()) {
|
||||||
showHelpUrl(links.front().second, LocalHelpManager::contextHelpOption());
|
showHelpUrl(links.front().second, LocalHelpManager::contextHelpOption());
|
||||||
} else {
|
} else {
|
||||||
QMap<QString, QUrl> map;
|
QMap<QString, QUrl> map;
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ void BaseHoverHandler::decorateToolTip()
|
|||||||
if (Qt::mightBeRichText(toolTip()))
|
if (Qt::mightBeRichText(toolTip()))
|
||||||
setToolTip(toolTip().toHtmlEscaped());
|
setToolTip(toolTip().toHtmlEscaped());
|
||||||
|
|
||||||
if (lastHelpItemIdentified().isValid()) {
|
if (lastHelpItemIdentified().isValid() && !lastHelpItemIdentified().isFuzzyMatch()) {
|
||||||
const QString &helpContents = lastHelpItemIdentified().extractContent(false);
|
const QString &helpContents = lastHelpItemIdentified().extractContent(false);
|
||||||
if (!helpContents.isEmpty()) {
|
if (!helpContents.isEmpty()) {
|
||||||
m_toolTip = toolTip().toHtmlEscaped();
|
m_toolTip = toolTip().toHtmlEscaped();
|
||||||
|
|||||||
Reference in New Issue
Block a user