changeset 26134:3a38afebf949

open external links indoc browser help files in the standard browser * documentation.cc (documentation_browser::documentation_browser): disable internal scheme for opening clicked urls and connect the related signal to own slot; (documentaiton_browser::handle_index_clicked): open url in doc browser if protocol is qthelp and in standard browser otherwise
author Torsten <mttl@mailbox.org>
date Sun, 25 Nov 2018 18:39:32 +0100
parents 84cd950f0f75
children a332d83cc659
files libgui/src/documentation.cc
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/documentation.cc	Sat Nov 24 20:52:59 2018 +0100
+++ b/libgui/src/documentation.cc	Sun Nov 25 18:39:32 2018 +0100
@@ -747,7 +747,11 @@
   // The documentation browser
   documentation_browser::documentation_browser (QHelpEngine *he, QWidget *p)
     : QTextBrowser (p), m_help_engine (he), m_zoom_level (0)
-  { }
+  {
+    setOpenLinks (false);
+    connect (this, SIGNAL (anchorClicked (QUrl)),
+             this, SLOT (handle_index_clicked (QUrl)));
+  }
 
   documentation_browser::~documentation_browser (void)
   { }
@@ -755,7 +759,10 @@
   void documentation_browser::handle_index_clicked (const QUrl& url,
                                                     const QString&)
   {
-    setSource (url);
+    if (url.scheme () == "qthelp")
+      setSource (url);
+    else
+      QDesktopServices::openUrl (url);
   }
 
   void documentation_browser::notice_settings (const QSettings *)