Prefer project's Qt version for context help

To avoid additional dependencies, let the QtSupport plugin register a
function for filtering help URLs, and add information about the
originating file path to the help items created by the context help
handlers. The filter hook then finds out the corresponding project,
active target, and corresponding Qt version, and filters the help URLs
accordingly.

With the default setting in "Kits > Qt Versions > Register
documentation", only the highest versioned documentation set within a
major Qt version is registered, so context help now shows the highest
versioned help from Qt 5 or Qt 6 depending on active target. If that is
changed to "All", context help now shows documentation from exactly the
version that is currently used by the project.

Fixes: QTCREATORBUG-10331
Change-Id: I7d87793737cc5ab7d228ee4bfe568d7e8343ee7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2022-09-23 13:20:12 +02:00
parent bf6914a704
commit e3f375925d
8 changed files with 187 additions and 46 deletions

View File

@@ -70,8 +70,10 @@ void CMakeEditor::contextHelp(const HelpCallback &callback) const
}
const QString id = "command/" + textAt(begin, end - begin).toLower();
callback(
{{id, Utils::Text::wordUnderCursor(editorWidget()->textCursor())}, {}, HelpItem::Unknown});
callback({{id, Utils::Text::wordUnderCursor(editorWidget()->textCursor())},
{},
{},
HelpItem::Unknown});
}
//