Salome HOME
Qt 5 migration: HelpBrowser does not open local files
authorvsr <vsr@opencascade.com>
Tue, 26 Jan 2016 11:38:37 +0000 (14:38 +0300)
committervsr <vsr@opencascade.com>
Tue, 26 Jan 2016 11:38:37 +0000 (14:38 +0300)
src/Qtx/QtxWebBrowser.cxx

index 43c3d938617758505e820d262c4b9cea1daadd95..304ce6145c5d28d63b6eea47c92c60be9c082039 100644 (file)
@@ -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 );
+  }
 }
 
 /*!