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:
@@ -451,18 +451,13 @@ QtWebKitHelpViewer::QtWebKitHelpViewer(qreal zoom, QWidget *parent)
|
||||
connect(m_webView->page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested()));
|
||||
connect(m_webView, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool)));
|
||||
connect(m_webView, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool)));
|
||||
|
||||
setViewerFont(viewerFont());
|
||||
}
|
||||
|
||||
QFont QtWebKitHelpViewer::viewerFont() const
|
||||
{
|
||||
QWebSettings* webSettings = QWebSettings::globalSettings();
|
||||
QFont font(QApplication::font().family(),
|
||||
QWebSettings* webSettings = m_webView->settings();
|
||||
return QFont(webSettings->fontFamily(QWebSettings::StandardFont),
|
||||
webSettings->fontSize(QWebSettings::DefaultFontSize));
|
||||
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
|
||||
return qvariant_cast<QFont>(engine.customValue(QLatin1String("font"),
|
||||
font));
|
||||
}
|
||||
|
||||
void QtWebKitHelpViewer::setViewerFont(const QFont &font)
|
||||
@@ -497,11 +492,6 @@ QString QtWebKitHelpViewer::title() const
|
||||
return m_webView->title();
|
||||
}
|
||||
|
||||
void QtWebKitHelpViewer::setTitle(const QString &title)
|
||||
{
|
||||
Q_UNUSED(title)
|
||||
}
|
||||
|
||||
QUrl QtWebKitHelpViewer::source() const
|
||||
{
|
||||
return m_webView->url();
|
||||
|
||||
Reference in New Issue
Block a user