diff --git a/src/plugins/help/localhelpmanager.cpp b/src/plugins/help/localhelpmanager.cpp index f63e20bfccf..e9e87250ed2 100644 --- a/src/plugins/help/localhelpmanager.cpp +++ b/src/plugins/help/localhelpmanager.cpp @@ -93,6 +93,7 @@ static const char kLastSelectedTabKey[] = "Help/LastSelectedTab"; static const char kViewerBackend[] = "Help/ViewerBackend"; static const char kQtWebEngineBackend[] = "qtwebengine"; +static const char kLitehtmlBackend[] = "litehtml"; static const char kTextBrowserBackend[] = "textbrowser"; static const int kDefaultFallbackFontSize = 14; @@ -326,9 +327,14 @@ HelpViewerFactory LocalHelpManager::defaultViewerBackend() } if (!backend.isEmpty()) qWarning("Help viewer backend \"%s\" not found, using default.", backend.constData()); - const Utils::optional factory = backendForId(kQtWebEngineBackend); - if (factory) - return *factory; + const Utils::optional webengineFactory = backendForId(kQtWebEngineBackend); + if (webengineFactory) + return *webengineFactory; + + const Utils::optional litehtmlFactory = backendForId(kLitehtmlBackend); + if (litehtmlFactory) + return *litehtmlFactory; + return backendForId(kTextBrowserBackend).value_or(HelpViewerFactory()); } @@ -349,7 +355,7 @@ QVector LocalHelpManager::viewerBackends() {kQtWebEngineBackend, tr("QtWebEngine"), []() { return new WebEngineHelpViewer; }}); #endif #ifdef QTC_LITEHTML_HELPVIEWER - result.append({"litehtml", tr("litehtml"), []() { return new LiteHtmlHelpViewer; }}); + result.append({kLitehtmlBackend, tr("litehtml"), []() { return new LiteHtmlHelpViewer; }}); #endif #ifdef QTC_MAC_NATIVE_HELPVIEWER result.append({"native", tr("WebKit"), []() { return new MacWebKitHelpViewer; }});