Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

Q3Wizard Class

TheQ3Wizard class provides a framework for wizard dialogs.More...

Header:#include <Q3Wizard>
Inherits:QDialog

Properties

Public Functions

Q3Wizard(QWidget * parent = 0, const char * name = 0, bool modal = false, Qt::WindowFlags f = 0)
~Q3Wizard()
virtual voidaddPage(QWidget * page, const QString & title)
virtual boolappropriate(QWidget * page) const
QPushButton *backButton() const
QPushButton *cancelButton() const
QWidget *currentPage() const
QPushButton *finishButton() const
QPushButton *helpButton() const
intindexOf(QWidget * page) const
virtual voidinsertPage(QWidget * page, const QString & title, int index)
QPushButton *nextButton() const
QWidget *page(int index) const
intpageCount() const
virtual voidremovePage(QWidget * page)
virtual voidsetAppropriate(QWidget * page, bool appropriate)
voidsetTitle(QWidget * page, const QString & title)
voidsetTitleFont(const QFont &)
virtual voidshowPage(QWidget * page)
QStringtitle(QWidget * page) const
QFonttitleFont() const

Reimplemented Public Functions

virtual booleventFilter(QObject * o, QEvent * e)
  • 8 public functions inherited fromQDialog
  • 220 public functions inherited fromQWidget
  • 29 public functions inherited fromQObject
  • 12 public functions inherited fromQPaintDevice

Public Slots

virtual voidsetBackEnabled(QWidget * page, bool enable)
virtual voidsetFinishEnabled(QWidget * page, bool enable)
virtual voidsetHelpEnabled(QWidget * page, bool enable)
virtual voidsetNextEnabled(QWidget * page, bool enable)
  • 5 public slots inherited fromQDialog
  • 19 public slots inherited fromQWidget
  • 1 public slot inherited fromQObject

Signals

voidhelpClicked()
voidselected(const QString & title)

Protected Functions

virtual voidlayOutButtonRow(QHBoxLayout * layout)
virtual voidlayOutTitleRow(QHBoxLayout * layout, const QString & title)
  • 7 protected functions inherited fromQDialog
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Protected Slots

virtual voidback()
virtual voidhelp()
virtual voidnext()
  • 1 protected slot inherited fromQWidget

Additional Inherited Members

  • 4 static public members inherited fromQWidget
  • 7 static public members inherited fromQObject

Detailed Description

TheQ3Wizard class provides a framework for wizard dialogs.

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.

Q3Wizard 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 usingsetBackEnabled(),setNextEnabled(),setFinishEnabled() andsetHelpEnabled().

Create and populate dialog pages that inherit fromQWidget and add them to the wizard usingaddPage(). UseinsertPage() to add a dialog page at a certain position in the page sequence. UseremovePage() to remove a page from the page sequence.

UsecurrentPage() to retrieve a pointer to the currently displayed page.page() returns a pointer to the page at a certain position in the page sequence.

UsepageCount() to retrieve the total number of pages in the page sequence.indexOf() will return the index of a page in the page sequence.

Q3Wizard provides functionality to mark pages as appropriate (or not) in the current context withsetAppropriate(). 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.

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.

Property Documentation

titleFont :QFont

This property holds the font used for page titles.

The default isQApplication::font().

Access functions:

QFonttitleFont() const
voidsetTitleFont(const QFont &)

Member Function Documentation

Q3Wizard::Q3Wizard(QWidget * parent = 0, constchar * name = 0,bool modal = false,Qt::WindowFlags f = 0)

Constructs an empty wizard dialog. Theparent,name,modal andf arguments are passed to theQDialog constructor.

Q3Wizard::~Q3Wizard()

Destroys the object and frees any allocated resources, including all pages and controllers.

[virtual]void Q3Wizard::addPage(QWidget * page, constQString & title)

Addspage to the end of the page sequence, with the title,title.

[virtual]bool Q3Wizard::appropriate(QWidget * page) const

Called when the Next button is clicked; this virtual function returns true ifpage is relevant for display in the current context; otherwise it is ignored byQ3Wizard and returns false. The default implementation returns the value set usingsetAppropriate(). The ultimate default is true.

Warning: The last page of the wizard will be displayed if no page is relevant in the current context.

See alsosetAppropriate().

[virtual protected slot]void Q3Wizard::back()

Called when the user clicks the Back button; this function shows the preceding relevant page in the sequence.

See alsoappropriate().

QPushButton * Q3Wizard::backButton() const

Returns a pointer to the dialog's Back button

By default, this button is connected to theback() slot, which is virtual so you can reimplement it in aQ3Wizard subclass. UsesetBackEnabled() to enable/disable this button.

QPushButton * Q3Wizard::cancelButton() const

Returns a pointer to the dialog's Cancel button

By default, this button is connected to theQDialog::reject() slot, which is virtual so you can reimplement it in aQ3Wizard subclass.

QWidget * Q3Wizard::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.

[virtual]bool Q3Wizard::eventFilter(QObject * o,QEvent * e)

Reimplemented fromQObject::eventFilter().

QPushButton * Q3Wizard::finishButton() const

Returns a pointer to the dialog's Finish button

By default, this button is connected to theQDialog::accept() slot, which is virtual so you can reimplement it in aQ3Wizard subclass. UsesetFinishEnabled() to enable/disable this button.

[virtual protected slot]void Q3Wizard::help()

Called when the user clicks the Help button, this function emits thehelpClicked() signal.

QPushButton * Q3Wizard::helpButton() const

Returns a pointer to the dialog's Help button

By default, this button is connected to thehelp() slot, which is virtual so you can reimplement it in aQ3Wizard subclass. UsesetHelpEnabled() to enable/disable this button.

[signal]void Q3Wizard::helpClicked()

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

int Q3Wizard::indexOf(QWidget * page) const

Returns the position of pagepage. If the page is not part of the wizard -1 is returned.

[virtual]void Q3Wizard::insertPage(QWidget * page, constQString & title,int index)

Insertspage at positionindex into the page sequence, with titletitle. Ifindex is -1, the page will be appended to the end of the wizard's page sequence.

[virtual protected]void Q3Wizard::layOutButtonRow(QHBoxLayout * layout)

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

layout is the horizontal layout of the entire wizard.

[virtual protected]void Q3Wizard::layOutTitleRow(QHBoxLayout * layout, constQString & title)

This virtual function is responsible for laying out the title row.

layout is the horizontal layout for the wizard, andtitle is the title for this page. This function is called every timetitle changes.

[virtual protected slot]void Q3Wizard::next()

Called when the user clicks the Next button, this function shows the next relevant page in the sequence.

See alsoappropriate().

QPushButton * Q3Wizard::nextButton() const

Returns a pointer to the dialog's Next button

By default, this button is connected to thenext() slot, which is virtual so you can reimplement it in aQ3Wizard subclass. UsesetNextEnabled() to enable/disable this button.

QWidget * Q3Wizard::page(int index) const

Returns a pointer to the page at positionindex in the sequence, or 0 ifindex is out of range. The first page has index 0.

int Q3Wizard::pageCount() const

Returns the number of pages in the wizard.

[virtual]void Q3Wizard::removePage(QWidget * page)

Removespage from the page sequence but does not delete the page. Ifpage is currently being displayed,Q3Wizard will display the page that precedes it, or the first page if this was the first page.

[signal]void Q3Wizard::selected(constQString & title)

This signal is emitted when the current page changes. Thetitle parameter contains the title of the selected page.

[virtual]void Q3Wizard::setAppropriate(QWidget * page,bool appropriate)

Ifappropriate is true then pagepage is considered relevant in the current context and should be displayed in the page sequence; otherwisepage should not be displayed in the page sequence.

See alsoappropriate().

[virtual slot]void Q3Wizard::setBackEnabled(QWidget * page,bool enable)

Ifenable is true, pagepage has a Back button; otherwisepage has no Back button. By default all pages have this button.

[virtual slot]void Q3Wizard::setFinishEnabled(QWidget * page,bool enable)

Ifenable is true, pagepage has a Finish button; otherwisepage has no Finish button. By defaultno page has this button.

[virtual slot]void Q3Wizard::setHelpEnabled(QWidget * page,bool enable)

Ifenable is true, pagepage has a Help button; otherwisepage has no Help button. By default all pages have this button.

[virtual slot]void Q3Wizard::setNextEnabled(QWidget * page,bool enable)

Ifenable is true, pagepage has a Next button; otherwise the Next button onpage is disabled. By default all pages have this button.

void Q3Wizard::setTitle(QWidget * page, constQString & title)

Sets the title for pagepage totitle.

See alsotitle().

[virtual]void Q3Wizard::showPage(QWidget * page)

Makespage the current page and emits theselected() signal.

This virtual function is called whenever a different page is to be shown, including the first time theQ3Wizard is shown. By reimplementing it (and calling Q3Wizard::showPage()), you can prepare each page prior to it being shown.

QString Q3Wizard::title(QWidget * page) const

Returns the title of pagepage.

See alsosetTitle().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp