[Interest] Displaying Help from QHelpEngine through QWebEngine

Allan Sandfeld Jensen kde at carewolf.com
Wed Feb 10 01:00:05 CET 2016


On Tuesday 09 February 2016, Mike Jackson wrote:
> I am attempting to use the QHelp* classes to allow our users to search
> our help files (html based) using the same mechanisms as those used with
> QAssistant. So far I have hacked together the major pieces and hooked
> everything up. I am able to manually generate a .qhc file from all of
> our html and image sources. I got so far as to enter a search string and
> have the relevant documents appear in the results widget. Now when I
> click on a link I would like to actually display the help. Currently we
> use QWebEngineView on Qt 5.5.1 because QWebKit was being deprecated. I
> am pretty sure the issue as to why nothing is displayed is because I get
> a URL like the following:
> 
> 
> "qthelp://bluequartzsoftware.net.dream3d.1.0/DREAM3D/addorientationnoise.ht
> ml"
> 
> 
> and QWebEngine probably has no idea what to do with that URL scheme. I
> have looked around the internet using Google and while other people are
> asking this same question there are no actual answers. About the only
> possibility seems to get the file contents from the HelpEngine along
> with any CSS and Image assets, write all of those to a temp location on
> the filesystem, then load the URL from the temp location? There must be
> an easier way that I am just missing.
> 
> 
> Any help is greatly appreciated.

What you need is the QWebEngineUrlSchemeHandler which was added in Qt 5.6. It 
adds the ability to add custom URL schemes to QtWebEngine.

Best regards
`Allan Jensen



More information about the Interest mailing list