From bd2806b05b5eca89d949ce0c84dad904d1d0c388 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 26 Jan 2016 14:38:37 +0300 Subject: [PATCH] Qt 5 migration: HelpBrowser does not open local files --- src/Qtx/QtxWebBrowser.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Qtx/QtxWebBrowser.cxx b/src/Qtx/QtxWebBrowser.cxx index 43c3d9386..304ce6145 100644 --- a/src/Qtx/QtxWebBrowser.cxx +++ b/src/Qtx/QtxWebBrowser.cxx @@ -621,11 +621,15 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force ) \brief Load URL \param url path to the file to be opened in the browser */ -void QtxWebBrowser::load( const QString& url ) -{ - QString u = url; - if ( !u.isEmpty() ) - myWebView->load( QUrl( u.replace('\\', '/') ) ); +void QtxWebBrowser::load( const QString& link ) +{ + QString linkPath = link; + linkPath.replace('\\', '/'); + QUrl url = linkPath; + if ( !url.isEmpty() ) { + if ( url.scheme().isEmpty() ) url.setScheme( "file" ); + myWebView->load( url ); + } } /*! -- 2.39.2