diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-12-15 17:32:24 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-12-17 14:29:53 +0000 |
commit | 91ffe63e1a0abe23a2207734cce14c65b7aca30c (patch) | |
tree | df8605010f2100aae7ab96230c29a1da997f2bd0 /src/plugins/help | |
parent | 55b01369237d8f870e043a9b536d91671ef74acd (diff) | |
download | qt-creator-91ffe63e1a0abe23a2207734cce14c65b7aca30c.tar.gz |
TextBrowserHelpViewer: Fix opening external links
External links were not opening at all. The logic for that was present
for TextBrowserHelpViewer::setSource, but clicking on links would
directly go through the text browsers loadResource method. Avoid that by
turning off openLinks and handling the anchorClicked signal instead.
Task-number: QTCREATORBUG-15491
Change-Id: I86017f14138b98738221c1aed42c37551feaf671
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/textbrowserhelpviewer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp index 710f00f870..747816dc8b 100644 --- a/src/plugins/help/textbrowserhelpviewer.cpp +++ b/src/plugins/help/textbrowserhelpviewer.cpp @@ -55,6 +55,7 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent) : HelpViewer(parent) , m_textBrowser(new TextBrowserHelpWidget(this)) { + m_textBrowser->setOpenLinks(false); QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); layout->setContentsMargins(0, 0, 0, 0); @@ -68,6 +69,8 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent) p.setColor(QPalette::Text, Qt::black); setPalette(p); + connect(m_textBrowser, &TextBrowserHelpWidget::anchorClicked, + this, &TextBrowserHelpViewer::setSource); connect(m_textBrowser, SIGNAL(sourceChanged(QUrl)), this, SIGNAL(titleChanged())); connect(m_textBrowser, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool))); connect(m_textBrowser, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool))); |