Home

OFF-SOFT.net

OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

Qt (8)-2 How to create QtHelp Files.

Published on| June 26th, 2009 | No Comment.
Description:
In Qt, Windows as a change in the HTML Help QtAssistant. (Listed in the article. )
QtAssistant this, the original file (SQLite3 format) files and qhc qch file is required. (Windows in the HTML equivalent to chm Help file. )

In this article, the HELP file for QtAssistant (qch files, qhc file) that describes how to create.

Articles: Qt (8) QtAssistant the GUI of the Japanese
Articles: http://doc.trolltech.com/4.5/qthelp.html

Sample source code you used here:

HELP QtAssistant for files
HELP QtAssistant for the file, there are two types of files.

File Type Commentary
. qch file Q t C ompressed H elp ie files, HTML documents are written in (including attached images and other information) to the SQLite3 database file is a summary.
Commpressed say, in fact, zlib compression and the like seems like it is not. (However, I personally feel, good, great size. )

Create qhelpgenerator command.

. qhc file Q t H elp C ollection simply files,. Qch more files, SQLite3 files are compiled into a database.
HTML entities in the document, only,. Qch file. This file,. Qch makes file management, as search and use.

Create qcollectiongenerator command.


Furthermore, these two original files exist for each file type.

File Type Commentary
. qhp file Q t H elp P roject file
Documents written in HTML (including images and information included) for managing a single project as an XML-based file.
Commpressed say, in fact, zlib compression and the like seems like it is not. (However, I personally feel, good, great size. )

qhelpgenerator command. qch into files.

. qhcp file Q t H elp P roject C ollection multiple files (or one). Qch files, one for the management of a collection of XML-based file.
Here, QtAssistant You can also customize some parts of the screen.

qcollectiongenerator command. qhc into files.


When you organize, you will see the following.
  • HELP project file (.qhp) ->.qch
  • HELP project Collection file (.qhcp) ->.qhc

Hey, it's complicated.
But here, as if caught, you may be able to understand somehow.
  • HTML Project Management
  • Management of the entire collection

Window in the HTML Help, and was organized as follows.
  • . hhc file (File Index)
  • . hhk file (Summary Administration)
  • . hhp file (Project Management)

These two files,. Chm files (HTML Help file) is created.

ini file format and XML format differences and, where writing is different, the basic information necessary for creating HTML help files, Qt good idea if you need any help.
Later, so please have a detailed description of the item.

Qt will help the former, HELP project file (. Qhp), HELP project Collection file(.qhcp) later explained the structure of a simple, Qt Let's create a Help file.

About HELP project file (. Qhp)
HELP project file (. Qhp) is, XML format, typically written in UTF8.

First, let's look at a simple example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
    <QtHelpProject version="1.0">
    <namespace>Sample_Help</namespace>
    <virtualFolder>doc</virtualFolder>
    <customFilter name="Sample Help 1.0">
        <filterAttribute>Sample Help Application</filterAttribute>
        <filterAttribute>1.0</filterAttribute>
    </customFilter>
    <filterSection>
        <filterAttribute>Test Help Application</filterAttribute>
        <filterAttribute>1.0</filterAttribute>
        <toc>
            <section title="Sample Help" ref="index.html">
                <section title="Chapter 1" ref="doc1.html"/>
                <section title="Chapter 2" ref="doc2.html"/>
                <section title="Chapter 3" ref="doc3.html"/>
            </section>
        </toc>
        <keywords>
            <keyword name="keyword1" id="TestHelp::key1" ref="doc1.html"/>
            <keyword name="keyword2" ref="doc2.html"  />
            <keyword id="TestHelp::key2" ref="doc3.html"/>
        </keywords>
        <files>
            <file>index.html</file>
            <file>doc1.html</file>
            <file>doc2.html</file>
            <file>doc3.html</file>
            <file>img1.png</file>
            <file>img2.png</file>
            <file>img3.png</file>
        </files>
    </filterSection>
</QtHelpProject>

Here, the following four are described as HTML in the document already.
  • index.html
  • doc1.html
  • doc2.html
  • doc3.html

The first line, XML declaration and the letter code specifying the format.
The second line, Qt is the specified version of the Help project. At 2009.6, "1.0" is the latest. Looking at this, the Qt help recently, you'll see that it was introduced.

3 for each subsequent tag line, easily explained in the following table.

HELP project file (. Qhp)
TAG Name Commentary
Namespace The name of this project (the address for access to this project)
virtualFolder Virtual directory name (Namespace will continue to addresses)
filterSection Filter definition

You define the default filter.

To define this filter, you can set the tag of the following more detailed.
  • filterAttribute Tags: filter name, and defines the version.
  • toc Tags: Defines the content tree.
    Here, section by using the tag information to display the tab content and specify the order by the hierarchy.
  • keywords tags: Define the index.
    Here, keyword tags are used to specify the keywords to display the Index tab.
  • files Tag: HTML to define the file is used in the document.
    Here, file that uses tags, HTML defines all files used in the document.
customFilter Define custom filters

filterSection tags can be defined as a filter to select the bar, or just to show the definition here.

Here, the point is to note, HTML is that you have to define all the files used in the document.
Related to files and images, CSS files, js must be aware that you must specify all the files.

If you specified only the HTML file with the HTML Help Workshop of Windows, the tool will take the file related to the HTML file automatically specified. But Qt's Help command do not work.

As might be expected, this has a sense of closure. (Soon, I want to improve. )

Continues, HELP Project Collection file(.qhcp) I would like to discuss.

About HELP project Collection file(.Qhcp)
HELP project Collection file(. Qhcp) is, XML format, typically written in UTF8.

HELP in the same project, let's look at a simple example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="utf-8" ?>
<QHelpCollectionProject version="1.0">
    <assistant>
        <title>Sample Help Applicatio Help</title>
        <startPage>qthelp://Sample_Help/doc/doc3.html</startPage>
        <currentFilter>Sample Help 1.0</currentFilter>
        <applicationIcon>star.png</applicationIcon>
        <enableFilterFunctionality>true</enableFilterFunctionality>
        <enableDocumentationManager>true</enableDocumentationManager>
        <enableAddressBar visible="true">true</enableAddressBar>
        <cacheDirectory>mycompany/myapplication</cacheDirectory>
        <aboutMenuText>
            <text>About Sample Help Application</text>
            <text language="ja">Sample Application ...</text>
        </aboutMenuText>
        <aboutDialog>
            <file>liecnce.txt</file>
            <file language="ja">liecnce_ja.txt</file>
            <icon>star.png</icon>
        </aboutDialog>
    </assistant>
    <docFiles>
        <generate>
            <file>
                <input>doc.qhp</input>
                doc.qch
            </file>
        </generate>
        <register>
            <file>doc.qch</file>
        </register>
    </docFiles>
</QHelpCollectionProject>

Here, HELP Project (doc.qhp) as we have already described.

The first line, XML declaration and the letter code specifying the format.
The second line, Qt is specified HELP Collection project version. At 2009.6, "1.0" is the latest. Looking at this, the Qt help recently, you'll see that it was introduced.

3 for each subsequent tag line, easily explained in the following table.

assistant of the tag is set, assistant operations are specified.
docFiles portion is set in the tag, which together specify the HELP project.

HELP Project collection file(.qhcp)
- Assistant tag
No TAG Name Commentary
(1) title Name Title
-- startPage Start page address
-- applicationIcon The top left corner image
(2) currentFilter The current filter name
(3) enableAddressBar To enable the address bar
(4) enableFilterFunctionality To enable the filter bar
(5) enableDocumentationManager Enabling Document Manager
-- cacheDirectory Houseroom temporary cache file
(6) aboutMenuText Help menu title
Using the text tag
(7) aboutDialog Customize About Dialog
file, icon use the tag

Each number on the part of the actual effects on the screen, please refer to it as described in the following screen.



HELP Project collection file(.qhcp)
- DocFiles Tags
TAG Name Commentary
generate Before you create a project file HELP collection (. Qhp) ->. Qch specify when you create the file.
tag file
    input tags: TOFAIRU input (. qhp file)
    Tag output: output file (. qch file)
register Subscribe to the collection Qt Compress Help file (. Qch) file specified in the file tags.

So far, When you are finally created by the command.

Qt to create help files
Qt help files (qch files, qhc files), create a command as described above.

Below,. Qhp files. Qch command is an example of when you create the file.
1
> qhelpgenerator doc.qhp -o doc.qch

Below,. Qhcp files. Qhc command is an example of when you create the file.
1
> qcollectiongenerator collection_doc.qhcp -o collection_doc.qhc


. qhcp generate files with. qhp files,. qch If the file is a command in the latter times,. qch files,. qhc you create the file.
(Ie, the former. Qch command file is created, it can be omitted. )

In this example, the following two files are created.
  • doc.qch
  • collection_doc.qhc

Now, Qt could help file.
Immediately, let's see.

From the command line, type the following.
1
> assistant -collectionFile collection_doc.qhc
※ is the current directory, collection_doc.qhc is the place.
※ As for this sample application, you do not operate if path is not put on 'Bin' at the installation destination of Qt.
Should not work, following the path of Qt installed the bin, again, please run.

Cases)
1
> set path=%path%;c:\qt\4.5\qt\bin

If you see the following screen is read correctly.




Yet, because I can not even been introduced, some that do not have everything in the environment. If Windows, HTML links to get help is that it is no less difficult, HTML, but also feel like a good help, Qt to create applications that are, basically, trying to multi-platform I think so, Qt think it is safe to create a help file to help along.

In addition, as described above, Qt help files, SQLite3 it is created, you can easily look inside.
Many may also develop an understanding of the table to peep through.

If you create an application, you also can distribute Qt distribution help,. Qch files,. Qhc, please note that you need to distribute a set of files.

Also, Qt is not the system is, QtAssistant required for the execution environment.
If the Windows environment, will not work unless at least the following files are also included.
  • ASSISTANT.EXE
  • QTHELP4.DLL
  • QTWEBKIT4.DLL
  • QTSQL4.DLL
  • QTGUI4.DLL
  • QTNETWORK4.DLL
  • QTCORE4.DLL

A little volume I have.
In the future, the application is too small, Qt environment, it may be unsuitable.
However, in recent years. Net than to download a set of environmental, may be cute.

In addition, the Qt help files, QtAssistant without the use of, and may even appear on the screen of their own.
The next article, I describe each in detail.


Comments

Leave a Reply







  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ