|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QAssistantClient Class Reference
[QtAssistant module]

The QAssistantClient class provides a means of using Qt Assistant as an application's help tool. More...

    #include <QAssistantClient>

Inherits QObject.

- List of all members, including inherited members

### Properties

- open : const bool

- 1 property inherited from QObject

### Public Functions

- QAssistantClient ( const QString & path, QObject * parent = 0 )
- ~QAssistantClient ()
- bool isOpen () const
- void setArguments ( const QStringList & arguments )

- 28 public functions inherited from QObject

### Public Slots

- virtual void closeAssistant ()
- virtual void openAssistant ()
- virtual void showPage ( const QString & page )

- 1 public slot inherited from QObject

### Signals

- void assistantClosed ()
- void assistantOpened ()
- void error ( const QString & message )

- 1 signal inherited from QObject

### Additional Inherited Members

- 4 static public members inherited from QObject
- 7 protected functions inherited from QObject

## Detailed Description

The QAssistantClient class provides a means of using Qt Assistant as an application's help tool.

Using Qt Assistant is simple: create a QAssistantClient instance, then call showPage() as often as necessary to show your help pages. When you call showPage(), Qt Assistant will be launched if it isn't already running.

The QAssistantClient instance can open (openAssistant()) or close (closeAssistant()) Qt Assistant whenever required. If Qt Assistant is open, isOpen() returns true.

One QAssistantClient instance interacts with one Qt Assistant instance, so every time you call openAssistant(), showPage() or closeAssistant() they are applied to the particular Qt Assistant instance associated with the QAssistantClient.

When you call openAssistant() the assistantOpened() signal is emitted. Similarly when closeAssistant() is called, assistantClosed() is emitted. In either case, if an error occurs, error() is emitted.

This class is not included in the Qt library itself. To use it you must link against `libqassistantclient.a` (Unix) or `qassistantclient.lib` (Windows), which is built into `INSTALL/lib` if you built the Qt tools (`INSTALL` is the directory where Qt is installed). If you use qmake, then you can simply add the following line to your pro file:

        LIBS += -lqassistantclient

See also Modifying The Default Documentation Set.

## Property Documentation

### open : const bool

This property holds whether Qt Assistant is open.

Access functions:

- bool isOpen () const

## Member Function Documentation

### QAssistantClient::QAssistantClient ( const QString & path, QObject * parent = 0 )

Constructs an assistant client with the given parent. The path specifies the path to the Qt Assistant executable. If path is an empty string the system path (`%PATH%` or `$PATH`) is used.

### QAssistantClient::~QAssistantClient ()

Destroys the assistant client object.

### void QAssistantClient::assistantClosed () `[signal]`

This signal is emitted when the connection to Qt Assistant is closed. This happens when the user exits Qt Assistant, if an error in the server or client occurs, or if closeAssistant() is called.

### void QAssistantClient::assistantOpened () `[signal]`

This signal is emitted when Qt Assistant is open and the client-server communication is set up.

### void QAssistantClient::closeAssistant () `[virtual slot]`

Use this function to close Qt Assistant.

See also assistantClosed().

### void QAssistantClient::error ( const QString & message ) `[signal]`

This signal is emitted if Qt Assistant cannot be started, or if an error occurs during the initialization of the connection between Qt Assistant and the calling application. The message provides an explanation of the error.

### void QAssistantClient::openAssistant () `[virtual slot]`

This function opens Qt Assistant, and sets up the client-server communiction between the application and Qt Assistant. If it is already open, this function does nothing. If an error occurs, error() is emitted.

See also assistantOpened().

### void QAssistantClient::setArguments ( const QStringList & arguments )

Sets the command line arguments used when Qt Assistant is started.

### void QAssistantClient::showPage ( const QString & page ) `[virtual slot]`

Call this function to make Qt Assistant show a particular page. The page is a filename (e.g. `myhelpfile.html`). See Qt Assistant Manual#Modifying the Default Documentation Set for further information.

If Qt Assistant hasn't been opened yet, this function will do nothing. You can use isOpen() to determine whether Qt Assistant is up and running, or you can connect to the asssistantOpened() signal.

See also isOpen() and assistantOpened().