Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QAssistantClient Class Reference

Inheritance diagram for QAssistantClient:


List of all members.

Detailed Description

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


In order to make Qt Assistant act as a customized help tool for your application, you must provide your application with a QAssistantClient object in addition to a {assistant-manual.htmlprofiles}{Qt Assistant Document Profile} (.adp file) and the associated documentation.

Note that the QAssistantClient class is not included in the Qt library. To use it you must add the following line to your pro file:

        CONFIG += assistant

A QAssistantClient instance can open or close Qt Assistant whenever it is required.

Once you have created a QAssistantClient instance, specifying the path to the Qt Assistant executable, using Qt Assistant is simple: You can either call the openAssistant() slot to show the defined start page of the documentation, or you can call the showPage() slot to show a particular help page. When you call openAssistant() and showPage(), Qt Assistant will be launched if it isn't already running. When Qt Assistant is running, the isOpen() function returns true.

When calling showPage() the Qt Assistant instance will also be brought to the foreground if its hidden. The showPage() slot can be called multiple times, while calling openAssistant() several times without closing the application in between, will have no effect.

You can close Qt Assistant at any time using the closeAssistant() slot. When you call openAssistant(), or you call showPage() without a previous call to openAssistant(), the assistantOpened() signal is emitted. Similarly when closeAssistant() is called, assistantClosed() is emitted. In either case, if an error occurs, error() is emitted.

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.

Qt Assistant's documentation set can be altered using the command line arguments that are passed to the application when it is launched. When started without any options, Qt Assistant displays a default set of documentation. When Qt is installed, the default documentation set in Qt Assistant contains the Qt reference documentation as well as the tools that come with Qt, such as and qmake.

Use the setArguments() function to specify the command line arguments. You can add or remove documentation from Qt Assistant by adding and removing the relevant content files: The command line arguments are {-addContentFile file.dcf} and {-removeContentFile file.dcf} respectively. You can make Qt Assistant run customized documentation sets that are separate from the Qt documentation, by specifying a profile: {-profile myapplication.adp}. The profile format can also be used to alter several of Qt Assistant's properties such as its title and startpage.

The Documentation Content File (.dcf) and Qt Assistant Documentation Profile (.adp) formats are documented in the {assistant-manual.html}{Qt Assistant Manual}.

For a complete example using the QAssistantClient class, see the {assistant/simpletextviewer}{Simple Text Viewer} example. The example shows how you can make Qt Assistant act as a customized help tool for your application using the QAssistantClient class combined with a Qt Assistant Document Profile.

See also:
{Qt Assistant Manual}, {Simple Text Viewer Example}

Definition at line 52 of file qassistantclient.h.

Public Slots

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


void assistantClosed ()
void assistantOpened ()
void destroyed (QObject *=0)
void error (const QString &msg)

Public Member Functions

bool blockSignals (bool b)
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
template<typename T>
findChild (const QString &name=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &name=QString()) const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isOpen () const
bool isWidgetType () const
void killTimer (int id)
void moveToThread (QThread *thread)
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
 QAssistantClient (const QString &path, QObject *parent=0)
void removeEventFilter (QObject *)
void setArguments (const QStringList &args)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
QObjectUserData * userData (uint id) const
 ~QAssistantClient ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
int receivers (const char *signal) const
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object
bool open
 whether Qt Assistant is open

Private Slots

void procError (QProcess::ProcessError err)
void readPort ()
void readStdError ()
void socketConnected ()
void socketConnectionClosed ()
void socketError ()

Private Attributes

QString assistantCommand
QString host
bool opened
QString pageBuffer
quint16 port


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name=QString(), T dummy=0)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index