Qt Toolkit - QWhatsThis Class

# QWhatsThis Class Reference

The QWhatsThis class provides a simple description of any widget, e.g. answering the question "what's this?" More...

`#include <qwhatsthis.h>`

List of all member functions.

## Static Public Members

- void add ( QWidget *, const char *, bool deepCopy = TRUE )
- void add ( QWidget *, const QPixmap &, const char *, const char *, bool deepCopy = TRUE )
- void remove ( QWidget * )
- const char* textFor ( QWidget * )
- QToolButton* whatsThisButton ( QWidget * parent )

## Detailed Description

The QWhatsThis class provides a simple description of any widget, e.g. answering the question "what's this?"

What's This help lies between tool tips and fully-blown online help systems:

- Tool Tips - flyweight help, extremely brief, entirely integrated in the user interface.
- What's This? - also lightweight, but can encompass a three-paragraph explanation.
- Online Help - can encompass any amount of information, but is typically a little slower to call up, a little separated from the user's work, and often users feel that using online help is a digression from their real task.

QWhatsThis, then, offers a single window with a single explanatory text, which pops up quickly when the user asks "what's this?", and goes away as soon as the user does something else. There are two ways to make QWhatsThis pop up: Click a "What's This?" button and then click on some other widget to get help for that other widget, or press Shift-F1 to get help for the widget that has keyboard focus.

QWhatsThis provides functions to add() and remove() What's This help for a widget, and it provides a function to create a What's This button suitable for typical tool bars.

More functionality will be provided in the coming releases of Qt.

See also: QToolTip.

## Member Function Documentation

### void QWhatsThis::add ( QWidget * widget, const QPixmap & icon, const char * title, const char * text, bool deepCopy = TRUE ) `[static]`

Adds text as What's This help for widget, with title line title and icon icon. If deepCopy is TRUE, QWhatsThis makes a deep copy of title and text; if it is FALSE QWhatsThis just copies the pointers.

### void QWhatsThis::add ( QWidget * widget, const char * text, bool deepCopy = TRUE ) `[static]`

Adds text as What's This help for widget. If deepCopy is TRUE, QWhatsThis makes a deep copy of the string; if it is FALSE QWhatsThis just copies the pointer text.

Examples: application/application.cpp

### void QWhatsThis::remove ( QWidget * widget ) `[static]`

Removes the What's This help for widget.

See also: add().

### const char * QWhatsThis::textFor ( QWidget * widget ) `[static]`

Returns the text (not the title) for widget, or 0 if there isn't any What's This help for widget.

See also: add().

### QToolButton * QWhatsThis::whatsThisButton ( QWidget * parent ) `[static]`

Returns a pointer to a specially configured QToolButton, suitable for use to enter What's This mode.

See also: QToolButton.

Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):

This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.

It was generated from the following files:

- qwhatsthis.h: 1998/08/19
- qwhatsthis.cpp: 1999/02/01