Qt Toolkit - QWizard Class

| Classes - Annotated - Tree - Functions - Home - Structure

# QWizard Class Reference

The QWizard class provides a framework for easily writing wizards. More...

`#include <qwizard.h>`

Inherits QDialog.

List of all member functions.

## Public Members

- QWizard ( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 )
- ~QWizard ()
- virtual void addPage ( QWidget *, const QString & )
- virtual void removePage ( QWidget * )
- QString title ( QWidget * ) const
- void setTitle ( QWidget *, const QString & )
- virtual void showPage ( QWidget * )
- QWidget* currentPage () const
- QWidget* page ( int pos ) const
- int pageCount () const
- virtual bool appropriate ( QWidget * ) const
- virtual void setAppropriate ( QWidget *, bool )
- QPushButton* backButton () const
- QPushButton* nextButton () const
- QPushButton* finishButton () const
- QPushButton* cancelButton () const
- QPushButton* helpButton () const

## Public Slots

- virtual void setBackEnabled ( QWidget *, bool )
- virtual void setNextEnabled ( QWidget *, bool )
- virtual void setFinishEnabled ( QWidget *, bool )
- virtual void setHelpEnabled ( QWidget *, bool )
- virtual void setFinish ( QWidget *, bool ) (obsolete)

## Signals

- void helpClicked ()
- void selected ( const QString & )

## Protected Members

- virtual void layOutButtonRow ( QHBoxLayout * )
- virtual void layOutTitleRow ( QHBoxLayout *, const QString & )

## Protected Slots

- virtual void back ()
- virtual void next ()
- virtual void help ()

## Detailed Description

The QWizard class provides a framework for easily writing wizards.

A wizard is a dialog that consists of a sequential number of steps, each consisting of a single page. QWizard provides a title for each page, and "Next", "Back", "Finish", "Cancel" and "Help" buttons, as appropriate.

## Member Function Documentation

### QWizard::QWizard ( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 )

Constructs an empty wizard dialog.

### QWizard::~QWizard ()

Destructs the object and frees any allocated resources, including, of course, all pages and controllers.

### void QWizard::addPage ( QWidget * page, const QString & title ) `[virtual]`

Adds page to the end of the wizard, titled title.

### bool QWizard::appropriate ( QWidget * w ) const `[virtual]`

This virtual function returns TRUE if w is appropriate for display in the current context of the wizard, and FALSE if QWizard should go on.

It is called when the Next button is clicked.

Warning: The last page of a wizard will be displayed if nothing else wants to, and the Next button was enabled when the user clicked.

The default implementation returns whatever was set using setAppropriate(). The ultimate default is TRUE.

### void QWizard::back () `[virtual protected slot]`

Called when the user clicks the Back button, this function shows the page which the user saw prior to the current one.

### QPushButton * QWizard::backButton () const

Returns the Back button of the dialog.

By default, this button is connected to the back() slot, which is virtual.

### QPushButton * QWizard::cancelButton () const

Returns the Cancel button of the dialog.

By default, this button is connected to the QDialog::reject() slot, which is virtual so you may reimplement it in a QWizard subclass.

### QWidget * QWizard::currentPage () const

Returns a pointer to the page currently being displayed by the wizard. The wizard does its best to make sure that this value is never 0, but if you try hard enough it can be.

### bool QWizard::eventFilter ( QObject * o, QEvent * e ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QObject.

### QPushButton * QWizard::finishButton () const

Returns the Finish button of the dialog.

By default, this button is connected to the QDialog::accept() slot, which is virtual so you may reimplement it in a QWizard subclass.

### void QWizard::help () `[virtual protected slot]`

This slot either makes the wizard help you, if it can. The only way it knows is to emit the helpClicked() signal.

### QPushButton * QWizard::helpButton () const

Returns the Help button of the dialog.

By default, this button is connected to the help() slot.

### void QWizard::helpClicked () `[signal]`

This signal is emitted when the user clicks on the help button.

### void QWizard::layOutButtonRow ( QHBoxLayout * layout ) `[virtual protected]`

This virtual function is responsible for adding the bottom divider and buttons below it.

layout is the vertical layout of the entire wizard.

### void QWizard::layOutTitleRow ( QHBoxLayout * layout, const QString & title ) `[virtual protected]`

This virtual function is responsible for laying out the title row and adding the vertical divider between the title and the wizard page. layout is the vertical layout for the wizard, title is the title for this page, and this function is called every time title changes.

### void QWizard::next () `[virtual protected slot]`

Called when the user clicks the Next button, this function shows the next appropriate page.

### QPushButton * QWizard::nextButton () const

Returns the Next button of the dialog.

By default, this button is connected to the next() slot, which is virtual.

### QWidget* QWizard::page ( int pos ) const

Returns a pointer to page a position pos, or 0 if pos is out of range. The first page has position 0.

### int QWizard::pageCount () const

Returns the number of pages in the wizard.

### void QWizard::removePage ( QWidget * page ) `[virtual]`

Removes page from this wizard. Does not delete page. If page is currently being displayed, QWizard will display something else.

### void QWizard::selected ( const QString & ) `[signal]`

This signal is emitted when the page changes, signalling the title of the page.

### void QWizard::setAppropriate ( QWidget * w, bool enable ) `[virtual]`

Sets whether it is appropriate for w to be displayed in the current context of the wizard.

See also appropriate().

### void QWizard::setBackEnabled ( QWidget * w, bool enable ) `[virtual slot]`

Enables or disables the "Back" button for pages w in the wizard. By default, all pages have this button.

### void QWizard::setFinish ( QWidget *, bool ) `[virtual slot]`

This function is obsolete. It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code.

### void QWizard::setFinishEnabled ( QWidget * w, bool enable ) `[virtual slot]`

Enables or disables the "Finish" button for pages w in the wizard. By default, no pages have this button.

### void QWizard::setFont ( const QFont & font ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

### void QWizard::setHelpEnabled ( QWidget * w, bool enable ) `[virtual slot]`

Enables or disables the "Help" button for pages w in the wizard. By default, all pages have this button.

### void QWizard::setNextEnabled ( QWidget * w, bool enable ) `[virtual slot]`

Enables or disables the "Next" button for pages w in the wizard. By default, all pages have this button.

### void QWizard::setTitle ( QWidget * page, const QString & t )

Sets the title for the page to title.

### void QWizard::show () `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

### void QWizard::showPage ( QWidget * page ) `[virtual]`

Makes page be the displayed page and emits the selected() signal.

### QString QWizard::title ( QWidget * page ) const

Returns the title of page.

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

This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.