You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqwizard.3qt

290 lines
13 KiB

'\" t
.TH QWizard 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QWizard \- Framework for wizard dialogs
.SH SYNOPSIS
\fC#include <ntqwizard.h>\fR
.PP
Inherits QDialog.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQWizard\fR ( QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )"
.br
.ti -1c
.BI "\fB~QWizard\fR ()"
.br
.ti -1c
.BI "virtual void \fBaddPage\fR ( QWidget * page, const QString & title )"
.br
.ti -1c
.BI "virtual void \fBinsertPage\fR ( QWidget * page, const QString & title, int index )"
.br
.ti -1c
.BI "virtual void \fBremovePage\fR ( QWidget * page )"
.br
.ti -1c
.BI "QString \fBtitle\fR ( QWidget * page ) const"
.br
.ti -1c
.BI "void \fBsetTitle\fR ( QWidget * page, const QString & title )"
.br
.ti -1c
.BI "QFont \fBtitleFont\fR () const"
.br
.ti -1c
.BI "void \fBsetTitleFont\fR ( const QFont & )"
.br
.ti -1c
.BI "virtual void \fBshowPage\fR ( QWidget * page )"
.br
.ti -1c
.BI "QWidget * \fBcurrentPage\fR () const"
.br
.ti -1c
.BI "QWidget * \fBpage\fR ( int index ) const"
.br
.ti -1c
.BI "int \fBpageCount\fR () const"
.br
.ti -1c
.BI "int \fBindexOf\fR ( QWidget * page ) const"
.br
.ti -1c
.BI "virtual bool \fBappropriate\fR ( QWidget * page ) const"
.br
.ti -1c
.BI "virtual void \fBsetAppropriate\fR ( QWidget * page, bool appropriate )"
.br
.ti -1c
.BI "QPushButton * \fBbackButton\fR () const"
.br
.ti -1c
.BI "QPushButton * \fBnextButton\fR () const"
.br
.ti -1c
.BI "QPushButton * \fBfinishButton\fR () const"
.br
.ti -1c
.BI "QPushButton * \fBcancelButton\fR () const"
.br
.ti -1c
.BI "QPushButton * \fBhelpButton\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "virtual void \fBsetBackEnabled\fR ( QWidget * page, bool enable )"
.br
.ti -1c
.BI "virtual void \fBsetNextEnabled\fR ( QWidget * page, bool enable )"
.br
.ti -1c
.BI "virtual void \fBsetFinishEnabled\fR ( QWidget * page, bool enable )"
.br
.ti -1c
.BI "virtual void \fBsetHelpEnabled\fR ( QWidget * page, bool enable )"
.br
.ti -1c
.BI "virtual void setFinish ( QWidget *, bool ) \fI(obsolete)\fR"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBhelpClicked\fR ()"
.br
.ti -1c
.BI "void \fBselected\fR ( const QString & )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "QFont \fBtitleFont\fR - the font used for page titles"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBlayOutButtonRow\fR ( QHBoxLayout * layout )"
.br
.ti -1c
.BI "virtual void \fBlayOutTitleRow\fR ( QHBoxLayout * layout, const QString & title )"
.br
.in -1c
.SS "Protected Slots"
.in +1c
.ti -1c
.BI "virtual void \fBback\fR ()"
.br
.ti -1c
.BI "virtual void \fBnext\fR ()"
.br
.ti -1c
.BI "virtual void \fBhelp\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QWizard class provides a framework for wizard dialogs.
.PP
A wizard is a special type of input dialog that consists of a sequence of dialog pages. A wizard's purpose is to walk the user through a process step by step. Wizards are useful for complex or infrequently occurring tasks that people may find difficult to learn or do.
.PP
QWizard provides page titles and displays Next, Back, Finish, Cancel, and Help push buttons, as appropriate to the current position in the page sequence. These buttons can be enabled/disabled using setBackEnabled(), setNextEnabled(), setFinishEnabled() and setHelpEnabled().
.PP
Create and populate dialog pages that inherit from QWidget and add them to the wizard using addPage(). Use insertPage() to add a dialog page at a certain position in the page sequence. Use removePage() to remove a page from the page sequence.
.PP
Use currentPage() to retrieve a pointer to the currently displayed page. page() returns a pointer to the page at a certain position in the page sequence.
.PP
Use pageCount() to retrieve the total number of pages in the page sequence. indexOf() will return the index of a page in the page sequence.
.PP
QWizard provides functionality to mark pages as appropriate (or not) in the current context with setAppropriate(). The idea is that a page may be irrelevant and should be skipped depending on the data entered by the user on a preceding page.
.PP
It is generally considered good design to provide a greater number of simple pages with fewer choices rather than a smaller number of complex pages.
.PP
Example code is available here: wizard/wizard.cpp wizard/wizard.h
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center> <blockquote><p align="center">\fI A QWizard page \fR</p> </blockquote>
.PP
See also Abstract Widget Classes, Dialog Classes, and Organizers.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QWizard::QWizard ( QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )"
Constructs an empty wizard dialog. The \fIparent\fR, \fIname\fR, \fImodal\fR and \fIf\fR arguments are passed to the QDialog constructor.
.SH "QWizard::~QWizard ()"
Destroys the object and frees any allocated resources, including all pages and controllers.
.SH "void QWizard::addPage ( QWidget * page, const QString & title )\fC [virtual]\fR"
Adds \fIpage\fR to the end of the page sequence, with the title, \fItitle\fR.
.SH "bool QWizard::appropriate ( QWidget * page ) const\fC [virtual]\fR"
Called when the Next button is clicked; this virtual function returns TRUE if \fIpage\fR is relevant for display in the current context; otherwise it is ignored by QWizard and returns FALSE. The default implementation returns the value set using setAppropriate(). The ultimate default is TRUE.
.PP
\fBWarning:\fR The last page of the wizard will be displayed if no page is relevant in the current context.
.SH "void QWizard::back ()\fC [virtual protected slot]\fR"
Called when the user clicks the Back button; this function shows the preceding relevant page in the sequence.
.PP
See also appropriate().
.SH "QPushButton * QWizard::backButton () const"
Returns a pointer to the dialog's Back button
.PP
By default, this button is connected to the back() slot, which is virtual so you can reimplement it in a QWizard subclass. Use setBackEnabled() to enable/disable this button.
.SH "QPushButton * QWizard::cancelButton () const"
Returns a pointer to the dialog's Cancel button
.PP
By default, this button is connected to the QDialog::reject() slot, which is virtual so you can reimplement it in a QWizard subclass.
.SH "QWidget * QWizard::currentPage () const"
Returns a pointer to the current page in the sequence. Although the wizard does its best to make sure that this value is never 0, it can be if you try hard enough.
.SH "QPushButton * QWizard::finishButton () const"
Returns a pointer to the dialog's Finish button
.PP
By default, this button is connected to the QDialog::accept() slot, which is virtual so you can reimplement it in a QWizard subclass. Use setFinishEnabled() to enable/disable this button.
.SH "void QWizard::help ()\fC [virtual protected slot]\fR"
Called when the user clicks the Help button, this function emits the helpClicked() signal.
.SH "QPushButton * QWizard::helpButton () const"
Returns a pointer to the dialog's Help button
.PP
By default, this button is connected to the help() slot, which is virtual so you can reimplement it in a QWizard subclass. Use setHelpEnabled() to enable/disable this button.
.SH "void QWizard::helpClicked ()\fC [signal]\fR"
This signal is emitted when the user clicks on the Help button.
.SH "int QWizard::indexOf ( QWidget * page ) const"
Returns the position of page \fIpage\fR. If the page is not part of the wizard -1 is returned.
.SH "void QWizard::insertPage ( QWidget * page, const QString & title, int index )\fC [virtual]\fR"
Inserts \fIpage\fR at position \fIindex\fR into the page sequence, with title \fItitle\fR. If \fIindex\fR is -1, the page will be appended to the end of the wizard's page sequence.
.SH "void QWizard::layOutButtonRow ( QHBoxLayout * layout )\fC [virtual protected]\fR"
This virtual function is responsible for adding the buttons below the bottom divider.
.PP
\fIlayout\fR is the horizontal layout of the entire wizard.
.SH "void QWizard::layOutTitleRow ( QHBoxLayout * layout, const QString & title )\fC [virtual protected]\fR"
This virtual function is responsible for laying out the title row.
.PP
\fIlayout\fR is the horizontal layout for the wizard, and \fItitle\fR is the title for this page. This function is called every time \fItitle\fR changes.
.SH "void QWizard::next ()\fC [virtual protected slot]\fR"
Called when the user clicks the Next button, this function shows the next relevant page in the sequence.
.PP
See also appropriate().
.SH "QPushButton * QWizard::nextButton () const"
Returns a pointer to the dialog's Next button
.PP
By default, this button is connected to the next() slot, which is virtual so you can reimplement it in a QWizard subclass. Use setNextEnabled() to enable/disable this button.
.SH "QWidget * QWizard::page ( int index ) const"
Returns a pointer to the page at position \fIindex\fR in the sequence, or 0 if \fIindex\fR is out of range. The first page has index 0.
.SH "int QWizard::pageCount () const"
Returns the number of pages in the wizard.
.SH "void QWizard::removePage ( QWidget * page )\fC [virtual]\fR"
Removes \fIpage\fR from the page sequence but does not delete the page. If \fIpage\fR is currently being displayed, QWizard will display the page that precedes it, or the first page if this was the first page.
.SH "void QWizard::selected ( const QString & )\fC [signal]\fR"
This signal is emitted when the current page changes. The parameter contains the title of the selected page.
.SH "void QWizard::setAppropriate ( QWidget * page, bool appropriate )\fC [virtual]\fR"
If \fIappropriate\fR is TRUE then page \fIpage\fR is considered relevant in the current context and should be displayed in the page sequence; otherwise \fIpage\fR should not be displayed in the page sequence.
.PP
See also appropriate().
.SH "void QWizard::setBackEnabled ( QWidget * page, bool enable )\fC [virtual slot]\fR"
If \fIenable\fR is TRUE, page \fIpage\fR has a Back button; otherwise \fIpage\fR has no Back button. By default all pages have this button.
.SH "void QWizard::setFinish ( QWidget *, bool )\fC [virtual slot]\fR"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Use setFinishEnabled instead
.SH "void QWizard::setFinishEnabled ( QWidget * page, bool enable )\fC [virtual slot]\fR"
If \fIenable\fR is TRUE, page \fIpage\fR has a Finish button; otherwise \fIpage\fR has no Finish button. By default \fIno\fR page has this button.
.SH "void QWizard::setHelpEnabled ( QWidget * page, bool enable )\fC [virtual slot]\fR"
If \fIenable\fR is TRUE, page \fIpage\fR has a Help button; otherwise \fIpage\fR has no Help button. By default all pages have this button.
.SH "void QWizard::setNextEnabled ( QWidget * page, bool enable )\fC [virtual slot]\fR"
If \fIenable\fR is TRUE, page \fIpage\fR has a Next button; otherwise the Next button on \fIpage\fR is disabled. By default all pages have this button.
.SH "void QWizard::setTitle ( QWidget * page, const QString & title )"
Sets the title for page \fIpage\fR to \fItitle\fR.
.SH "void QWizard::setTitleFont ( const QFont & )"
Sets the font used for page titles. See the "titleFont" property for details.
.SH "void QWizard::showPage ( QWidget * page )\fC [virtual]\fR"
Makes \fIpage\fR the current page and emits the selected() signal.
.PP
This virtual function is called whenever a different page is to be shown, including the first time the QWizard is shown. By reimplementing it (and calling QWizard::showPage()), you can prepare each page prior to it being shown.
.PP
Examples:
.)l distributor/distributor.ui.h and wizard/wizard.cpp.
.SH "QString QWizard::title ( QWidget * page ) const"
Returns the title of page \fIpage\fR.
.SH "QFont QWizard::titleFont () const"
Returns the font used for page titles. See the "titleFont" property for details.
.SS "Property Documentation"
.SH "QFont titleFont"
This property holds the font used for page titles.
.PP
The default is QApplication::font().
.PP
Set this property's value with setTitleFont() and get this property's value with titleFont().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqwizard.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqwizard.3qt) and the Qt
version (3.3.8).