0

I am using Qt 4.6 so do C++.

I have a User Manual (.chm) for my application which has the help required for the users to run the application. Now I want this help to be integrated into my application, so that when the user selects for help from the application, the user manual will be opened with the corresponding help page displayed. In this way I can make use of the already available manual and users will find easy to probe through the document. (since it is familiar)

The user manual file is in the .chm format which has corresponding search keywords, which can be used to display the corresponding page when selected from the application. Just similar to F1 help in any of the windows application.

Is it possible to do this in Qt or C++? Or

What are the other ways through which the help can be integrated in the application?

Any pointers regarding this are welcome..

4 Answers 4

2

Yes, it's possible. The help system infrastructure was designed to integrate with normal Win32 development in Visual Studio, but this is not technically necessary. Basically you just call HtmlHelp(GetDesktopWindow(), "Yourhelp.chm", HH_HELP_CONTEXT, IDYourCurrentContext);.

4
  • Can you elaborate on HtmlHelp() function. Basically am used to Qt but the function does sound like a VC++ one.
    – liaK
    Commented Jul 28, 2010 at 10:38
  • It's not VC++ specific, but a general Win32 API function. Include Htmlhelp.h and link to Htmlhelp.lib (you get these by installing HTML Help workshop, but I presume you already have these if you made a .chm)
    – MSalters
    Commented Jul 28, 2010 at 10:54
  • Cool.. Is it possible for me to pass the value for Index item from this function so that it directly loads the desired page??
    – liaK
    Commented Jul 28, 2010 at 12:40
  • The precise value doesn't matter as long as your application and the .chm agree.
    – MSalters
    Commented Jul 28, 2010 at 14:32
1

The more Qt way of Help Integration can also be done which is as follows.

The chm files are always opened by the hh.exe

So,

QProcess::execute("hh.exe D:/Manual.chm");

can be used to open the Manual.chm file from the application.

The command

QProcess::execute("hh.exe D:/Manual.chm::page1.htm");

will open the chm file with the page1.htm loaded. This will be helpful to load a specific help page in the chm file.

The only thing we must be aware in this approach is that we must have known the file name of the web pages (here page1.htm) previously..

Hope this one also helps... :)

1

QDesktopServices::openUrl() would be even more Qt way. Then you do not need to specify hh.exe but rely instead on the system file associations to use proper application. Hence - portability, the key thing behind Qt stuff.

0

try using libCHMxx or CHM lib along with Qt help system (see this sample)

Not the answer you're looking for? Browse other questions tagged or ask your own question.