forked from qt-creator/qt-creator
Help: Provide native WebView backend on Mac
Run Qt Creator with environment variable QTC_HELPVIEWER_BACKEND to * 'native' to get the WebView based one on Mac * 'textbrowser' to get the QTextBrowser based one Defaults to use QWebView if QtWebKit is available, or QTextBrowser if not, like before. Change-Id: If0660782b18ff3d89301fa7bcaf4e2e2fb69627d Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
|
||||
#include "localhelpmanager.h"
|
||||
|
||||
#include <bookmarkmanager.h>
|
||||
#include "bookmarkmanager.h"
|
||||
#include "helpconstants.h"
|
||||
|
||||
#include <app/app_version.h>
|
||||
#include <coreplugin/helpmanager.h>
|
||||
@@ -40,6 +41,8 @@
|
||||
|
||||
using namespace Help::Internal;
|
||||
|
||||
static LocalHelpManager *m_instance = 0;
|
||||
|
||||
QMutex LocalHelpManager::m_guiMutex;
|
||||
QHelpEngine* LocalHelpManager::m_guiEngine = 0;
|
||||
|
||||
@@ -51,6 +54,7 @@ LocalHelpManager::LocalHelpManager(QObject *parent)
|
||||
, m_guiNeedsSetup(true)
|
||||
, m_needsCollectionFile(true)
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
LocalHelpManager::~LocalHelpManager()
|
||||
@@ -65,6 +69,11 @@ LocalHelpManager::~LocalHelpManager()
|
||||
m_guiEngine = 0;
|
||||
}
|
||||
|
||||
LocalHelpManager *LocalHelpManager::instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
void LocalHelpManager::setupGuiHelpEngine()
|
||||
{
|
||||
if (m_needsCollectionFile) {
|
||||
@@ -110,3 +119,16 @@ BookmarkManager& LocalHelpManager::bookmarkManager()
|
||||
}
|
||||
return *m_bookmarkManager;
|
||||
}
|
||||
|
||||
QVariant LocalHelpManager::engineFontSettings()
|
||||
{
|
||||
return helpEngine().customValue(Constants::FontKey, QVariant());
|
||||
}
|
||||
|
||||
QByteArray LocalHelpManager::helpData(const QUrl &url)
|
||||
{
|
||||
const QHelpEngineCore &engine = helpEngine();
|
||||
|
||||
return engine.findFile(url).isValid() ? engine.fileData(url)
|
||||
: tr("Could not load \"%1\".").arg(url.toString()).toUtf8();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user