This document introduces Qt Assistant, a tool for presenting on-line documentation. It also introduces the Qt Reference Documentation which is accessible using Qt Assistant, or with a web browser. The document is divided into the following sections:
Table of contents:
- The One-Minute Guide to Using Qt Assistant
- Introduction to the Qt Reference Documentation
- Qt Assistant in More Detail
- Full Text Searching
The One-Minute Guide to Using Qt Assistant
Once you have installed Qt, Qt Assistant should be ready to run:
- On Windows, Qt Assistant is available as a menu option on the Qt menu.
- On Mac OS X, Qt Assistant is installed in the /Developer/Applications/Qt directory.
- On Unix/Linux, open a terminal, type
assistantand press Enter.
When you start up Qt Assistant, you will be presented with a standard main window application, with a menu bar and toolbar. Below these, on the left hand side are navigation windows called Contents, Index and Bookmarks. On the right, taking up most of the space, is the Documentation window. By default, Qt Assistant loads the Qt reference documentation along with the manuals of other Qt tools, like Qt Designer or Qt Linguist.
Qt Assistant works in a similar way to a Web browser. If you click hyperlinks (cross-references), the Documentation window will present the relevant page. You can bookmark pages of particular interest and you can click the Previous and Next toolbar buttons to navigate within the pages you have visited.
Although Qt Assistant can be used just like a Web browser to navigate through the documentation, Qt Assistant offers a powerful means of navigation that Web browsers do not provide. Qt Assistant uses an advanced full text search engine to index all the pages in each compressed help file so that you can search for particular words and phrases.
To perform an index search, click the Index tab on the Sidebar (or press Alt+I). In the 'Look For' line edit enter a word; e.g., 'homedirpath'. As you type, words are found and highlighted in a list beneath the line edit. If the highlighted text matches what you're looking for, double click it, (or press Enter) and the Documentation window will display the relevant page. You rarely have to type in the whole word before Qt Assistant finds a match. Note that for some words there may be more than one possible page that is relevant.
Qt Assistant also provides full text searching for finding specific words in the documentation. To activate the full text search, either press (Alt+S) or click on the Search tab in the Documentation window. Then enter the term you're looking for and hit the Search button. All documents containing the specified term will then be listed in the list box below.
Introduction to the Qt Reference Documentation
The documentation for the Qt library is written in-line in the
.cpp files by the developers themselves. The documentation team revises the documentation to ensure that it is accurate and usable, and to provide quality control. The documentation team also writes the larger texts, such as the class descriptions that introduce a class along with the concepts the class uses, as well as introducing the functions and properties that the class provides.
The documentation focuses on the API rather than the internals, since we make great efforts to keep our API consistent and compatible with each new version, but we may change the internals considerably to improve performance and enhance functionality.
The Qt Reference Documentation consists of almost 1,500 HTML pages (over 2,500 printed pages). The overwhelming majority of pages document Qt classes. Since developers differ in the way they think and work we provide a variety of approaches to navigating the documentation set:
- The Qt's Classes page lists every class in Qt's public API, and consists of several hundred classes.
- The Qt's Main Classes page lists the classes you're most likely to use most often, and provides a much shorter and more managable list than the All Classes list.
- The Grouped Classes page presents a list of groups, each of which leads to a list of related classes, for example, the Advanced Widgets list.
- The Class Inheritance Hierarchy page presents a list of classes in terms of the hierarchy of Qt classes.
- The Member Function Index page lists all the functions provided by Qt classes, each one with links to the class(es) in which it appears.
No matter where you find yourself in the Qt documentation, you will find extensive cross-referencing. Even snippets of example code contain clickable links, so that for example, if you come across a class declaration in a code example, the class name will be a clickable link to the class's documentation.
In addition to the class documentation some of Qt's modules have extensive descriptions, and there are many overview documents which describe various aspects of the Qt library; all these are linked from the reference documentation home page. There are also two tutorials and numerous example programs in the examples subdirectory of the Qt distribution.
Qt Assistant in More Detail
Command Line Options
Qt Assistant handles the following command line options:
|Command Line Option||Brief Description|
|-collectionFile <file.qhc>||Uses the specified collection file instead of the default one.|
|-showUrl URL||Shows the document referenced by URL.|
|-enableRemoteControl||Enables Qt Assistant to be remotly controlled.|
|-show <widget>||Shows the specified dockwidget which can be "contents", "index", "bookmarks" or "search".|
|-hide <widget>||Hides the specified dockwidget which can be "contents", "index", "bookmarks" or "search.|
|-activate <widget>||Activates the specified dockwidget which can be "contents", "index", "bookmarks" or "search.|
|-register <doc.qch>||Registers the specified compressed help file in the given help collection.|
|-unregister <doc.qch>||Unregisters the specified compressed help file from the given collection file.|
|-quiet||Doesn't show any error, warning or success messages.|
The tool windows provide four ways to navigate the documentation:
- The Contents window presents a table of contents implemented as a tree view for the documentation that is available. If you click an item, its documentation will appear in the Documentation window. If you double click an item or click on the control to the left of it, the item's sub-items will appear. Click a sub-item to make its page appear in the Documentation window. Click on the control next to an open item to hide its sub-items.
- The Index window is used to look up key words or phrases. See The One-Minute Guide to Using Qt Assistant for how to use this window.
- The Bookmarks window lists any bookmarks you have made. Double click a bookmark to make its page appear in the Documentation window. The Bookmarks window provides a context menu with Show Item, Delete Item as well as Rename Item. Click in the main menu Bookmark|Add Bookmark... (or press Ctrl+B) to bookmark the page that is currently showing in the Documentation window. Right click a bookmark in the list to rename or delete the highlighted bookmark.
If you want the Documentation window to use as much space as possible, you can easily group, move or hide the tool windows. To group the windows, drag one on top of the other and release the mouse. If one or all tool windows are not shown, press Alt+C, Alt+I or Alt+O to show the required window.
The tool windows can be docked into the main window, so you can drag them to the top, left, right or bottom of Qt Assistant's window, or you can drag them outside Qt Assistant to float them as independent windows.
The Documentation window lets you create a tab for each documentation page that you view. Click the Add Tab button and a new tab will appear with the page name as the tab's caption. This makes it convenient to switch between pages when you are working with different documentation. You can delete a tab by clicking the Close Tab button located on the right side of the Documentation window.
The main toolbar provides fast access to the most common actions.
|Previous||Takes you to the previous page in the history.||Go|Previous||Alt+Left Arrow|
|Next||Takes you to the next page in the history.||Go|Next||Alt+Right Arrow|
|Home||Takes you to the home page as specified in the Preferences Dialog.||Go|Home||Ctrl+Home.|
|Sync with Table of Contents||Synchronizes the Contents tool window with the page currently shown in the Documentation window.||Go|Sync with Table of Contents|
|Copy||Copies any selected text to the clipboard.||Edit|Copy||Ctrl+C|
|Opens the Print dialog.||File|Print||Ctrl+P|
|Find in Text||Opens the Find Text dialog.||Edit|Find in Text||Ctrl+F|
|Zoom in||Increases the font size used to display text in the current tab.||View|Zoom in||Ctrl++|
|Zoom out||Decreases the font size used to display text in the current tab.||View|Zoom out||Ctrl+-|
|Normal Size||Resets the font size to its normal size in the current tab.||View|Normal Size||Ctrl+0|
The address toolbar provides a fast way to enter a specific URL for a documentation file. By default, the address toolbar is not shown, so it has to be activated via View|Toolbars|Address Toolbar.
The filter toolbar allows you to apply a filter to the currently installed documentation. As with the address toolbar, the filter toolbar is not visible by default and has to be activated via View|Toolbars|Filter Toolbar.
- File|Page Setup... invokes a dialog allowing you to define page layout properties, such as margin sizes, page orientation and paper size.
- File|Print Preview... provides a preview of the printed pages.
- File|Print... opens the Print dialog.
- File|New Tab opens a new empty tab in the Documentation window.
- File|Close Tab closes the current tab of the Documentation window.
- File|Exit closes the Qt Assistant application.
- Edit|Copy copies any selected text to the clipboard.
- Edit|Find in Text invokes the Find Text control at the lower end of the Documentation window.
- Edit|Find Next looks for the next occurance of the specified text in the Find Text control.
- Edit|Find Previous looks for the previous occurance of the specified text in the Find Text control.
- Edit|Preferences invokes the Preferences dialog.
- View|Zoom in increases the font size in the current tab.
- View|Zoom out decreases the font size in the current tab.
- View|Normal Size resets the font size in the current tab.
- View|Contents toggles the display of the Contents tool window.
- View|Index toggles the display of the Index tool window.
- View|Bookmarks toggles the display of the Bookmarks tool window.
- View|Search toggles the display of the Search in the Documentation window.
- Go|Home goes to the home page.
- Go|Back displays the previous page in the history.
- Go|Forward displays the next page in the history.
- Go|Sync with Table of Contents syncs the Contents tool window to the currently shown page.
- Go|Next Page selects the next tab in the Documentation window.
- Go|Previous Page selects the previous tab in the Documentation window.
- Bookmarks|Add adds the current page to the list of bookmarks.
This dialog is platform-specific. It gives access to various printer options and can be used to print the document shown in the current tab.
The Fonts page allows you to change the font family and font sizes of the browser window displaying the documentation or the application itself.
The Filters page lets you create and remove documentation filters. To add a new filter, click the Add button, specify a filter name in the pop-up dialog and click OK, then select the filter attributes in the list box on the right hand side. You can delete a filter by selecting it and clicking the Remove button.
The Documentation page lets you install and remove compressed help files. Click the Install button and choose the path of the compressed help file (*.qch) you would like to install. To delete a help file, select a documentation set in the list and click Remove.
The Options page lets you specify the homepage Qt Assistant will display when you click the Home button in Qt Assistant's main user interface. You can specify the hompage by typing it here or clicking on one of the buttons below the textbox. Current Page sets the currently displayed page as your home page while Restore to default will reset your home page to the default home page.
Find Text Control
This control is used to find text in the current page. Enter the text you want to find in the line edit. The search is incremental, meaning that the most relevant result is shown as you enter characters into the line edit.
If you check the Whole words only checkbox, the search will only consider whole words; for example, if you search for "spin" with this checkbox checked it will not match "spinbox", but will match "spin". If you check the Case sensitive checkbox then, for example, "spin" will match "spin" but not "Spin". You can search forwards or backwards from your current position in the page by clicking the Previous or Next buttons. To hide the find control, either click the Close button or hit the Esc key.
Filtering Help Contents
Qt Assistant allows you to install any kind of documentation as long as it is organized in Qt compressed help files (*.qch). For example, it is possible to install the Qt reference documentation for Qt 4.4.0 and Qt 4.4.1 at the same time. In many respects, this is very convenient since only one version of Qt Assistant is needed. However, at the same time it becomes more complicated when performing tasks like searching the index because nearly every keyword is defined in Qt 4.4.0 as well as in Qt 4.4.1. This means that Qt Assistant will always ask the user to choose which one should be displayed.
We use documentation filters to solve this issue. A filter is identified by its name, and contains a list of filter attributes. An attribute is just a string and can be freely chosen. Attributes are defined by the documentation itself, this means that every documentation set usually has one or more attributes.
For example, the Qt 4.4.0 Qt Assistant documentation defines the attributes
4.4.0, Qt Designer defines
4.4.0. The filter to display all tools would then define only the attribute
tools since this attribute is part of both documentation sets. Adding the attribute
assistant to the filter would then only show Qt Assistant documentation since the Qt Designer documentation does not contain this attribute. Having an empty list of attributes in a filter will match all documentation; i.e., it is equivalent to requesting unfiltered documentation.
Full Text Searching
Qt Assistant provides a powerful full text search engine. To search for certain words or text, click the Search tab in the Documentation window. Then enter the text you want to look for and press Enter or click the Search button. The search is not case sensitive, so, for example, Foo, fOo and FOO are all treated as the same. The following are examples of common search patterns:
deep-- lists all the documents that contain the word 'deep'
deep*-- lists all the documents that contain a word beginning with 'deep'
deep copy-- lists all documents that contain both 'deep' and 'copy'
"deep copy"-- list all documents that contain the phrase 'deep copy'
It is also possible to use the Advanced search to get more flexibility. You can specify some words so that hits containing these are excluded from the result, or you can search for an exact phrase. Searching for similar words will give results like these:
QStin-- lists all the documents with titles that are similar, such as
QSting-- lists all the documents with titles that are similar, such as
QStrin-- lists all the documents with titles that are similar, such as
Options can be combined to improve the search results.
The list of documents found is ordered according to the number of occurrences of the search text which they contain, with those containing the highest number of occurrences appearing first. Simply click any document in the list to display it in the Documentation window.
If the documentation has changed — for example, if documents have been added or removed — Qt Assistant will index them again.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.