[Development] QtHelp Module

Jordi Pujol pisoengracia at gmail.com
Wed Apr 25 17:01:32 CEST 2012


Hi all,

I'm trying to embed a context-sensitive help system to my app. And I
wonder why QtHelp module was left in the middle :-(

I'll try to explain : you create your fancy-shiny-great-rich html/css
based documentation ( doxygen or similar ) and you put it in a qch file.

Then, you want to use QHelpEngine & co. to show the help embedded in
yout app.

Following an aged tutorial , you can embed in a form some widgets
without too much effort. *BUT* QTextBrowser is not enough for you. You
have to use QWebView to allow a richer subset of HTML.

But QWebView doesn't understand url's like 'qthelp://...". Well, don't
panic, look at assistant sources to see how trolls made this : It's a
bit a mess !! Do I have to repeat that code to have the same behaviour &
aspect ?

So, looking at qtassistant's MainWindow.cpp I think that a "generic help
form" can be added into QtHelp module to avoid reinventing the wheel for
every Qt application.

The idea is to have a class QHelpBrowser that can be simply inserted in
any widget to have an embedded qtassistant.

In assistant's code, main.cpp will remain the same and MainWindow.cpp
could be split in two : the strictly MainWindow needed code ( cmd line
parsing & assistat's main form related stuff ) and a new class, shared
with QtHelp module, that has all striclty related to help navigation
stuff. Obviously, with the possibility to hide/show index, find,
contents, etc.

What do you think about this idea ?

	J.




More information about the Development mailing list