开发者

Help Integration in Qt/C++ Application

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 a开发者_StackOverflow社区vailable 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..


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);.


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... :)


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜