\chapter Introduction

This document introduces \QA, a tool for presenting on-line
documentation. It also introduces the Qt Reference Documentation which
is accessible using \QA, or with a web browser. The document is
divided into the following sections:

\list
\i Introduction to the Qt Reference Documentation
\i The 1 Minute Guide to using Qt Assistant
\i Qt Assistant in More Detail
\i Full Text Searching
\i Adding Documentation to Qt Assistant
\endlist

\chapter Introduction to the Qt Reference Documentation

The documentation for the Qt library is written in-line in the \File
.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: 

\list

\i The \link classes.html All Classes\endlink page lists every class
in Qt's public API, and consists of several hundred classes.

\i The \link mainclasses.html Main Classes\endlink 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.

\i The \link groups.html Grouped Classes\endlink page presents a list
of groups, each of which leads to a list of related classes, for
example, the \link advanced.html Advanced Widgets\endlink list.

\i The \link hierarchy.html Inheritance Hierarchy\endlink page
presents a list of classes in terms of the hierarchy of Qt classes.

\i The \link functions.html All Functions\endlink page lists all the
functions provided by Qt classes, each one with links to the class(es)
in which it appears.

\endlist

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 numerous example
programs in $QTDIR/examples and two tutorials.

\chapter The 1 Minute Guide to using Qt Assistant

Under Windows, \QA is available as a menu option on the Qt menu. On
Unix, run \c{$QTDIR/bin/assistant} from an xterm.

When you start up \QA, you will be presented with a standard
main-window style application, with a menu bar and toolbar. Below
these, on the left hand side is a navigation window called the \e
Sidebar, and on the right, taking up most of the space, is the
documentation window. By default, the Qt Reference Documentation's home
page is shown in the documentation window.

\QA works in a similar way to a web browser. If you click underlined
text (which signifies a cross-reference), the documentation window will
present the relevant page. You can bookmark pages of particular
interest and you can click the \Toolbutton Previous and \Toolbutton
Next toolbar buttons to navigate within the pages you've visited. 

Although \QA can be used just like a web browser to navigate through the
Qt documentation set, \QA offers a powerful means of navigation that
web browsers don't provide. \QA uses an intelligent algorithm to index
all the pages in the documentation sets that it presents so that you
can search for particular words and phrases.

To perform a search, click the \Toolbutton Index tab on the Sidebar
(or click \Key Ctrl+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 \Key Enter) and the
documentation window will display the relevant page. You rarely have
to type in the whole word before \QA finds a match.

For some words there may be more than one possible page that is
relevant. For example, enter 'setenabled' in the 'Look For' line edit.
As you type, words are found and highlighted in the list beneath the
line edit, as before. Once the highlighted text matches what you're
looking for, double click it, (or press \Key Enter). In the case of
setEnabled, it is a function name which occurs in several classes, so
a dialog pops up listing the possible choices. Click the choice you're
interested in (or move to it using the \Key Up and \Key Down arrow
keys and press \Key Enter). The relevant page will display in the
documentation window. 

\chapter Qt Assistant in More Detail

\section1 The Sidebar

The sidebar provides three ways of navigating documentation:
\list 1
\i The \Toolbutton Contents tab presents a tree view of the
documentation sets that are available. If you click an item, its
documentation will appear in the documentation window. If you double
click an item or click a '+' sign to the left of an item, the item's
sub-items will appear. Click a sub-item to make its page appear in the
documentation window. Click a '-' sign to the left of an item to hide
its sub-items.
\i The \Toolbutton Index tab is used to look up key words or phrases.
See \l{The 1 Minute Guide to using Qt Assistant} for how to use this
tab.
\i The \Toolbutton Bookmarks tab lists any bookmarks you've made.
Double click a bookmark to make its page appear in the documentation
window. The \Toolbutton Bookmarks tab has a \Button{New Bookmark}
button and a \Button{Delete Bookmark} button at the bottom. Click
\Button{New Bookmark} to bookmark the page that is showing in the
documentation window. Click a bookmark in the list, then click 
\Button{Delete Bookmark} to delete the highlighted bookmark.
\i The \Toolbutton Search tab provides full text search of \e all
the documents. For further information see \l{Full Text Searching}.
\endlist

If you want the documentation window to use as much space as possible,
you can easily hide or show the Sidebar. If the Sidebar is showing,
press \Key Ctrl+T, \Key Ctrl+I, \Key Ctrl+B or \Key Ctrl+S to hide it.
If the Sidebar is hidden, press \Key Ctrl+T to show it on the Contents
tab, or press \Key Ctrl+I to show it on the Index tab (with the focus
in the 'Look For' line edit box), or press \Key Ctrl+B to show it on
the Bookmarks tab, or press \Key Ctrl+S to show it on the (full text)
Search tab.

The Sidebar is a dock window, so you can drag it to the top, left,
right or bottom of \QA's window, or you can drag it outside \QA to
float it.

\section1 The Toolbar

The toolbar provides fast access to the most common actions.
\list
\i \Toolbutton Previous takes you to the previous page. The menu
option is \Menu Go|Previous and the keyboard shortcut is \Key{Alt+Left
Arrow}.
\i \Toolbutton Next takes you to the next page. The menu
option is \Menu Go|Next and the keyboard shortcut is \Key{Alt+Right
Arrow}.
\i \Toolbutton Home takes you to the home page (normally the home page
of the Qt Reference Documentation). The menu
option is \Menu Go|Home and the keyboard shortcut is \Key{Ctrl+Home}.
\i \Toolbutton Copy copies any selected text to the clipboard. The menu
option is \Menu Edit|Copy and the keyboard shortcut is \Key{Ctrl+C}.
\i \Toolbutton{Find in Text} invokes the \Dialog{Find Text} dialog. The menu
option is \Menu{Edit|Find in Text} and the keyboard shortcut is \Key{Ctrl+F}.
\i \Toolbutton{Print} invokes the \Dialog{Print} dialog. The menu
option is \Menu{File|Print} and the keyboard shortcut is \Key{Ctrl+P}.
\i \Toolbutton{Zoom in} increases the font size. The menu
option is \Menu{View|Zoom in} and the keyboard shortcut is \Key{Ctrl++}.
\i \Toolbutton{Zoom out} decreases the font size. The menu
option is \Menu{View|Zoom out} and the keyboard shortcut is \Key{Ctrl+-}.
\endlist

The remaining toolbar buttons are bookmarks and will vary depending on
your configuration.

\section1 The Menus

\section2 The File Menu

\list
\i \Menu{File|Print} invokes the \Dialog{Print} dialog.
\i \Menu{File|Exit} terminates \QA.
\endlist

\section2 The Edit Menu

\list
\i \Menu{Edit|Copy} copies any selected text to the clipboard.
\i \Menu{Edit|Find in Text} invokes the \Dialog{Find Text} dialog.
\i \Menu{Edit|Settings} invokes the \Dialog{Settings} dialog.
\endlist

\section2 The View Menu

\list
\i \Menu{View|Zoom in} increases the font size.
\i \Menu{View|Zoom out} decreases the font size.
\i \Menu{View|Views|Sidebar} toggles the display of the Sidebar.
\i \Menu{View|Views|Toolbar} toggles the display of the Toolbar.
\i \Menu{View|Views|Line up} lines up the toolbar buttons in the
Toolbar.
\endlist

\section2 The Go Menu

\list
\i \Menu{Go|Previous} display the previous page.
\i \Menu{Go|Next} display the next page.
\i \Menu{Go|home} go to the home page.
\endlist
This menu also has additional items; these are pre-defined bookmarks
that vary depending on your configuration.

\section2 The Bookmarks Menu

\list
\i \Menu{Bookmarks|Add} add the current page to the list of bookmarks.
\endlist
This menu may have additional items, i.e. any bookmarks that you have
already made. If you want to delete a bookmark go to the Bookmarks tab
on the Sidebar.

\section1 The Dialogs

\section2 The Print Dialog

This dialog is platform-specific. It gives access to various printer
options and can be used to print the current page.

\section2 The Find Text Dialog

This dialog is used to find text in the current page. Enter the text
you want to find in the Find line edit. If you check the 'Whole words
only' checkbox, the search will only consider whole words, i.e. if you
search for 'spin' with this checkbox checked it will not match
'spinbox', but will match 'spin'. If you check the 'Case sensitive'
check box then, for example, 'spin' will match 'spin' but not 'Spin'.
You can search Forward or Backward from your current position in the
page by clicking one of the Direction radio buttons. Click the \Button
Find button to search (or search again), and click the \Button Close
button to finish.

\section2 The Settings Dialog

This dialog is used to set your preferences for \QA. In order to 
confirm your changes click \Button OK; or click \Button Cancel
to keep the previous settings. \QA will remember your 
settings between sessions, including window sizes and positions, 
and which pages you have open. The Settings dialog contains the
following tabs:

\list
\i General Settings

To change the base font used throughout \QA, select a 
font type from the Font combobox. To choose a new fixed-width 
font, to show code snippets for example, choose a font type from 
the 'Fixed font' combobox. To change the color of hypertext 
links, click the 'Link color' color button. Uncheck the 
'Underline links' checkbox if you don't want underlined links. 

\i Web Settings 

Some pages contain links to external web pages. In order to display
these links, you must specify a web browser. Click \Button Browse to
invoke the \Widget Assistant dialog and navigate until you find the
web browser you wish to use. Click \OK to accept the
selection. Alternatively, type in the name of your browser's
executable in the line edit.

\i Documentations 

To add your own documentation to \QA, click \Button Add to invoke the
\Widget Assistant dialog. Navigate through the files until you find
the documentation you want to add and then click \OK. Click \Button
Delete to remove obsolete documentation from the Documentations
list box. Read more about adding your own documentation in the next
chapter, \l {Adding Documentation to Qt Assistant}. 

\i Categories

All documentation is categorized, for example,
development, office, multimedia, etc. To create a new category, type
its name in the Category Name line edit and click \Button Add. The
new category appears in the Categories list box with a checkbox to its
left. Leave the box checked to display all of the category's
available documentation. To remove a category, select it from the list
box and click \Button Delete. For further information about
categories read the next chapter, \l {Adding Documentation to Qt Assistant}.
\endlist

\chapter Full Text Searching

From Qt 3.1, \QA offers a powerfull full text search engine. In order
to search for certain words or text, go to the 'Search' tab in the
sidebar. Then enter the text you are looking for and press \Key Enter
or click \Button Search. The search is always case insensitive, so
Foo, fOo and FOO are all treated as the same. The following search
patterns can be used:

\list
\i \c deep -- lists all the documents that contain the word 'deep'

\i \c{deep*} -- lists all the documents that contain a word beginning
with 'deep'

\i \c{deep copy} -- lists all documents that contain both 'deep' \e
and 'copy'

\i \c{"deep copy"} -- list all documents that contain the phrase 'deep copy'
\endlist

The wildcard (*) character cannot be used within quotes. 

The list of documents is ordered according to the number of
occurrences of the search text they contain, with those with the
highest number of occurrences appearing first. Simply click any
document in the list to have it display in the document pane.

If the documentation is changed, e.g. if new documents are added or
old ones removed, \QA will reindex. At present this only works for
latin1 encoded documents, i.e. Unicode is not yet supported.

\chapter Adding Documentation to Qt Assistant

Adding new documentation to \QA is straight-forward. You simply
specify a new documentation content file for \QA to use.

Click \Menu Edit|Settings to invoke the \Widget Settings dialog. Click
the \Menu{Documentations} tab. Now click \Button Add to invoke a
file open dialog. Select the new documentation's content file. (This
file must be an XML file in \QA's documentation content file format.)

Another way to add your own documentation is, to start \QA with the
commandline option '-addContentFile' followed by the documentation
content file.
Example: assistant -addContentFile /mycompany/myapp/help.xml

\QA will parse this file, add it and quit, i.e. no mainwindow will
be shown. This way can be used when adding documentation during an
installation process. 

If the new documentation belongs to a category which does not
currently appear in the Categories list box, you can add the category
using the \Widget Settings dialog. It is not normally necessary to do
this manually since \QA detects new categories and adds them
automatically. 

The format of the documentation content file is described in the
following section.


\section1 Documentation Content File format

The file must contain the documentation's table of contents and all
important keywords for the index. Furthermore, it should inherit a
category specification.

An example of a content file with all available tags is shown below:

\c demodoc.xml

\code
<!DOCTYPE DCF>
<DCF ref="demo.html" category="qt/development" title="Development Demo Handbook">
<section ref="./chap1/chap1.html" title="Chapter1">
    <section ref="./chap1/section1.html" title="Section1">
	<keyword ref="./chap1/section1.html#foo">foo</keyword>
	<keyword ref="./chap1/section1.html#bla">bla</keyword>
	<section ref="./chap1/section1.html#subsection1" title="Subsection 1"/>
	<section ref="./chap1/section1.html#subsection2" title="Subsection 2"/>
	<section ref="./chap1/section1.html#subsection3" title="Subsection 3"/>
    </section>
    <section ref="./chap1/section2" title="Section2">
	<section ref="./chap1/section2.html#subsection1" title="Subsection 1"/>
	<section ref="./chap1/section2.html#subsection2" title="Subsection 2"/>
	<section ref="./chap1/section2.html#subsection3" title="Subsection 3"/>
    </section>
</section>
<section ref="./chap2/chap2.html" title="Chapter2">
    <keyword ref="./chap2/chap2.html#foo">foo</keyword>
    <section ref="./chap2/section1.html" title="Section1"/>
</section>
</DCF>
\endcode

Sections may be nested as deeply as necessary. All references should
be related. 

Note that any \c keyword tags for a given section must appear \e
before any sections nested within the given section.

The paths in the \c refs attribute are always written Unix-style
(forward slashes) and are relative to the location of the
documentation content file itself.

