[Qt-interest] QWebView local image problem

Dominic Stalder dominic.stalder at bluewin.ch
Thu Dec 24 20:14:59 CET 2009


Thanks for your help, but this doesn't work.

When I specify the baseUrl, the links of the QHelpContentWidget don't 
work anymore and it always shows the top of the page.

I attached the HelpDialog and also the qt help files, hope this makes it 
easier.

Regards and have a nice christmas
Dominic


Strahinja Markovic schrieb:
> Dominic Stalder wrote:
>
>   
>> Hi
>>
>> I can't find my old post, so sorry if I double post ;-)
>>
>> I want to show my qhelp via the QWebView, at this time it works like this:
>>
>>     // gets the byte array of the online help
>>     QByteArray help = helpEngine->fileData(url);
>>    
>>     // sets the content of the help browser based on the given url
>>     helpBrowser->setContent(help, QString("text/html"), url);
>>
>> The url looks like this qthelp://ch.bfh.wiitetris/doc/onlinehilfe.html
>>
>> This works, but now I can't see any images. The images are in a special
>> folder in the /doc directory (the same place as onlinehilfe.html is
>> located). The images are referenced as follow: <img
>> src="figures/menu_game.png" alt="PIC">
>>
>> Has anybody some tips?
>>
>> Regards
>> Dominic
>>     
>
> You need to specify a correct baseUrl. So if your images are referenced with 
> "figures/menu_game.png", and the path to the "figures" folder is 
> "qthelp://ch.bfh.wiitetris/doc/figures/", then your baseUrl should be 
> "qthelp://ch.bfh.wiitetris/doc/". That way when webkit looks for 
> "figures/menu_game.png", it will prepend "qthelp://ch.bfh.wiitetris/doc/" 
> and load "qthelp://ch.bfh.wiitetris/doc/figures/menu_game.png".
>
> Hope that helps.
>
> Sincerely,
>
> Strahinja Markovic
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwebview.zip
Type: application/zip
Size: 685760 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091224/79acff2f/attachment.zip 


More information about the Qt-interest-old mailing list