Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QWizardPage

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.core.QObject
                  com.trolltech.qt.gui.QWidget
                      com.trolltech.qt.gui.QWizardPage

All Implemented Interfaces:
  QPaintDeviceInterface, QtJambiInterface

    public class QWizardPage

extends QWidget

The `QWizardPage` class is the base class for wizard pages.

`QWizard` represents a wizard. Each page is a `QWizardPage`. When you create your own wizards, you can use `QWizardPage` directly, or you can subclass it for more control.

A page has the following attributes, which are rendered by `QWizard`: a title, a `subTitle`, and a set of pixmaps. See Elements of a Wizard Page for details. Once a page is added to the wizard (using QWizard::addPage() or QWizard::setPage()), `wizard` returns a pointer to the associated `QWizard` object.

Page provides five virtual functions that can be reimplemented to provide custom behavior:

- `initializePage` is called to initialize the page's contents when the user clicks the wizard's Next button. If you want to derive the page's default from what the user entered on previous pages, this is the function to reimplement.
- `cleanupPage` is called to reset the page's contents when the user clicks the wizard's Back button.
- `validatePage` validates the page when the user clicks Next or Finish. It is often used to show an error message if the user has entered incomplete or invalid information.
- `nextId` returns the ID of the next page. It is useful when creating non-linear wizards, which allow different traversal paths based on the information provided by the user.
- `isComplete` is called to determine whether the Next and/or Finish button should be enabled or disabled. If you reimplement `isComplete`, also make sure that `completeChanged` is emitted whenever the complete state changes.

Normally, the Next button and the Finish button of a wizard are mutually exclusive. If `isFinalPage` returns true, Finish is available; otherwise, Next is available. By default, `isFinalPage` is true only when `nextId` returns -1. If you want to show Next and Final simultaneously for a page (letting the user perform an "early finish"), call `setFinalPage`(true) on that page. For wizards that support early finishes, you might also want to set the HaveNextButtonOnLastPage and HaveFinishButtonOnEarlyPages options on the wizard.

In many wizards, the contents of a page may affect the default values of the fields of a later page. To make it easy to communicate between pages, `QWizard` supports a "field" mechanism that allows you to register a field (e.g., a `QLineEdit`) on a page and to access its value from any page. Fields are global to the entire wizard and make it easy for any single page to access information stored by another page, without having to put all the logic in `QWizard` or having the pages know explicitly about each other. Fields are registered using registerField() and can be accessed at any time using `field` and `setField`.

See Also:
  `QWizard`, `Wizard Example`, `Wizard Example`

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
`QWidget.RenderFlag, QWidget.RenderFlags`

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>`

Field Summary
`QSignalEmitter.Signal0` | `completeChanged` This signal is emitted whenever the complete state of the page (i.e., the value of `isComplete`) changes.

Fields inherited from class com.trolltech.qt.gui.QWidget
`customContextMenuRequested`

Constructor Summary
`QWizardPage()` Equivalent to `QWizardPage`(0).
`QWizardPage(QWidget parent)` Constructs a wizard page with the given `parent`.

Method Summary
`java.lang.String` | `buttonText(QWizard.WizardButton which)` Returns the text on button `which` on this page.
`void` | `cleanupPage()` This virtual function is called by QWizard::cleanupPage() when the user clicks Back (unless the QWizard::IndependentPages option is set).
`protected java.lang.Object` | `field(java.lang.String name)` Returns the value of the field called `name`.
`static QWizardPage` | `fromNativePointer(QNativePointer nativePointer)` This function returns the QWizardPage instance pointed to by nativePointer
`void` | `initializePage()` This virtual function is called by QWizard::initializePage() to prepare the page just before it is shown.
`boolean` | `isCommitPage()` Returns true if this page is a commit page; otherwise returns false.
`boolean` | `isComplete()` This virtual function is called by `QWizard` to determine whether the Next or Finish button should be enabled or disabled.
`boolean` | `isFinalPage()` This function is called by `QWizard` to determine whether the Finish button should be shown for this page or not.
`int` | `nextId()` This virtual function is called by QWizard::nextId() to find out which page to show when the user clicks the Next button.
`QPixmap` | `pixmap(QWizard.WizardPixmap which)` Returns the pixmap set for role `which`.
`protected void` | `registerField(java.lang.String name, QWidget widget)` Creates a field called `name` associated with the given property of the given widget.
`void` | `setButtonText(QWizard.WizardButton which, java.lang.String text)` Sets the text on button `which` to be `text` on this page.
`void` | `setCommitPage(boolean commitPage)` Sets this page to be a commit page if `commitPage` is true; otherwise, sets it to be a normal page.
`protected void` | `setField(java.lang.String name, java.lang.Object value)` Sets the value of the field called `name` to `value`.
`void` | `setFinalPage(boolean finalPage)` Explicitly sets this page to be final if `finalPage` is true.
`void` | `setPixmap(QWizard.WizardPixmap which, QPixmap pixmap)` Sets the pixmap for role `which` to `pixmap`.
`void` | `setSubTitle(java.lang.String subTitle)` Sets the subtitle of the page to `subTitle`.
`void` | `setTitle(java.lang.String title)` Sets the title of the page to `title`.
`java.lang.String` | `subTitle()` Returns the subtitle of the page.
`java.lang.String` | `title()` Returns the title of the page.
`boolean` | `validatePage()` This virtual function is called by QWizard::validateCurrentPage() when the user clicks Next or Finish to perform some last-minute validation.
`protected QWizard` | `wizard()` Returns the wizard associated with this page, or 0 if this page hasn't been inserted into a `QWizard` yet.

Methods inherited from class com.trolltech.qt.gui.QWidget
`acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, ensurePolished, enterEvent, event, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y`

Methods inherited from class com.trolltech.qt.core.QObject
`blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`disconnect, disconnect, signalSender`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Field Detail

### completeChanged

    public final QSignalEmitter.Signal0 completeChanged

  This signal is emitted whenever the complete state of the page (i.e., the value of `isComplete`) changes.

  If you reimplement `isComplete`, make sure to emit `completeChanged` whenever the value of `isComplete` changes, to ensure that `QWizard` updates the enabled or disabled state of its buttons.

  Compatible Slot Signature:
    `void mySlot()`
  See Also:
    `isComplete`

Constructor Detail

### QWizardPage

    public QWizardPage()

  Equivalent to `QWizardPage`(0).

### QWizardPage

    public QWizardPage(QWidget parent)

  Constructs a wizard page with the given `parent`.

  When the page is inserted into a wizard using QWizard::addPage() or QWizard::setPage(), the parent is automatically set to be the wizard.

  See Also:
    `wizard`

Method Detail

### buttonText

    public final java.lang.String buttonText(QWizard.WizardButton which)

  Returns the text on button `which` on this page.

  If a text has ben set using `setButtonText`, this text is returned. Otherwise, if a text has been set using QWizard::setButtonText(), this text is returned.

  By default, the text on buttons depends on the QWizard::wizardStyle. For example, on Mac OS X, the Next button is called Continue.

  See Also:
    `setButtonText`, `QWizard::buttonText`, `QWizard::setButtonText`

### field

    protected final java.lang.Object field(java.lang.String name)

  Returns the value of the field called `name`.

  This function can be used to access fields on any page of the wizard. It is equivalent to calling `wizard`->field(`name`).

  Example:

          void OutputFilesPage::initializePage()
          {
              QString className = field("className").toString();
              headerLineEdit->setText(className.toLower() + ".h");
              implementationLineEdit->setText(className.toLower() + ".cpp");
              outputDirLineEdit->setText(QDir::convertSeparators(QDir::tempPath()));
          }

  See Also:
    `QWizard::field`, `setField`, `registerField`

### isCommitPage

    public final boolean isCommitPage()

  Returns true if this page is a commit page; otherwise returns false.

  See Also:
    `setCommitPage`

### isFinalPage

    public final boolean isFinalPage()

  This function is called by `QWizard` to determine whether the Finish button should be shown for this page or not.

  By default, it returns true if there is no next page (i.e., `nextId` returns -1); otherwise, it returns false.

  By explicitly calling `setFinalPage`(true), you can let the user perform an "early finish".

  See Also:
    `isComplete`, `QWizard::HaveFinishButtonOnEarlyPages`

### pixmap

    public final QPixmap pixmap(QWizard.WizardPixmap which)

  Returns the pixmap set for role `which`.

  Pixmaps can also be set for the entire wizard using QWizard::setPixmap(), in which case they apply for all pages that don't specify a pixmap.

  See Also:
    `setPixmap`, `QWizard::pixmap`, Elements of a Wizard Page

### setButtonText

    public final void setButtonText(QWizard.WizardButton which,
                                    java.lang.String text)

  Sets the text on button `which` to be `text` on this page.

  By default, the text on buttons depends on the QWizard::wizardStyle, but may be redefined for the wizard as a whole using QWizard::setButtonText().

  See Also:
    `buttonText`, `QWizard::setButtonText`, `QWizard::buttonText`

### setCommitPage

    public final void setCommitPage(boolean commitPage)

  Sets this page to be a commit page if `commitPage` is true; otherwise, sets it to be a normal page.

  A commit page is a page that represents an action which cannot be undone by clicking Back or Cancel.

  A Commit button replaces the Next button on a commit page. Clicking this button simply calls QWizard::next() just like clicking Next does.

  A page entered directly from a commit page has its Back button disabled.

  See Also:
    `isCommitPage`

### setField

    protected final void setField(java.lang.String name,
                                  java.lang.Object value)

  Sets the value of the field called `name` to `value`.

  This function can be used to set fields on any page of the wizard. It is equivalent to calling `wizard`->setField(`name`, `value`).

  See Also:
    `QWizard::setField`, `field`, `registerField`

### setFinalPage

    public final void setFinalPage(boolean finalPage)

  Explicitly sets this page to be final if `finalPage` is true.

  After calling `setFinalPage`(true), `isFinalPage` returns true and the Finish button is visible (and enabled if `isComplete` returns true).

  After calling `setFinalPage`(false), `isFinalPage` returns true if `nextId` returns -1; otherwise, it returns false.

  See Also:
    `isFinalPage`, `isComplete`, `QWizard::HaveFinishButtonOnEarlyPages`

### setPixmap

    public final void setPixmap(QWizard.WizardPixmap which,
                                QPixmap pixmap)

  Sets the pixmap for role `which` to `pixmap`.

  The pixmaps are used by `QWizard` when displaying a page. Which pixmaps are actually used depend on the wizard style.

  Pixmaps can also be set for the entire wizard using QWizard::setPixmap(), in which case they apply for all pages that don't specify a pixmap.

  See Also:
    `pixmap`, `QWizard::setPixmap`, Elements of a Wizard Page

### setSubTitle

    public final void setSubTitle(java.lang.String subTitle)

  Sets the subtitle of the page to `subTitle`.

  The subtitle is shown by the `QWizard`, between the title and the actual page. Subtitles are optional. In ClassicStyle and ModernStyle, using subtitles is necessary to make the header appear. In MacStyle, the subtitle is shown as a text label just above the actual page.

  The subtitle may be plain text or HTML, depending on the value of the `QWizard::subTitleFormat` property.

  See Also:
    `subTitle`, title, `QWizard::IgnoreSubTitles`, Elements of a Wizard Page

### setTitle

    public final void setTitle(java.lang.String title)

  Sets the title of the page to `title`.

  The title is shown by the `QWizard`, above the actual page. All pages should have a title.

  The title may be plain text or HTML, depending on the value of the `QWizard::titleFormat` property.

  See Also:
    `title`, `subTitle`, Elements of a Wizard Page

### subTitle

    public final java.lang.String subTitle()

  Returns the subtitle of the page.

  The subtitle is shown by the `QWizard`, between the title and the actual page. Subtitles are optional. In ClassicStyle and ModernStyle, using subtitles is necessary to make the header appear. In MacStyle, the subtitle is shown as a text label just above the actual page.

  The subtitle may be plain text or HTML, depending on the value of the `QWizard::subTitleFormat` property.

  See Also:
    `setSubTitle`, title, `QWizard::IgnoreSubTitles`, Elements of a Wizard Page

### title

    public final java.lang.String title()

  Returns the title of the page.

  The title is shown by the `QWizard`, above the actual page. All pages should have a title.

  The title may be plain text or HTML, depending on the value of the `QWizard::titleFormat` property.

  See Also:
    `setTitle`, `subTitle`, Elements of a Wizard Page

### wizard

    protected final QWizard wizard()

  Returns the wizard associated with this page, or 0 if this page hasn't been inserted into a `QWizard` yet.

  See Also:
    `QWizard::addPage`, `QWizard::setPage`

### cleanupPage

    public void cleanupPage()

  This virtual function is called by QWizard::cleanupPage() when the user clicks Back (unless the QWizard::IndependentPages option is set).

  The default implementation resets the page's fields to their original values (the values they had before `initializePage` was called).

  See Also:
    `QWizard::cleanupPage`, `initializePage`, `QWizard::IndependentPages`

### initializePage

    public void initializePage()

  This virtual function is called by QWizard::initializePage() to prepare the page just before it is shown. (However, if the `QWizard::IndependentPages` option is set, this function is only called the first time the page is shown.)

  By reimplementing this function, you can ensure that the page's fields are properly initialized based on fields from previous pages. For example:

          void OutputFilesPage::initializePage()
          {
              QString className = field("className").toString();
              headerLineEdit->setText(className.toLower() + ".h");
              implementationLineEdit->setText(className.toLower() + ".cpp");
              outputDirLineEdit->setText(QDir::convertSeparators(QDir::tempPath()));
          }

  The default implementation does nothing.

  See Also:
    `QWizard::initializePage`, `cleanupPage`, `QWizard::IndependentPages`

### isComplete

    public boolean isComplete()

  This virtual function is called by `QWizard` to determine whether the Next or Finish button should be enabled or disabled.

  The default implementation returns true if all mandatory fields are filled; otherwise, it returns false.

  If you reimplement this function, make sure to emit `completeChanged` whenever the value of `isComplete` changes, to ensure that `QWizard` updates the enabled or disabled state of its buttons.

  See Also:
    `completeChanged`, `isFinalPage`

### nextId

    public int nextId()

  This virtual function is called by QWizard::nextId() to find out which page to show when the user clicks the Next button.

  By default, this function returns the page with the following ID in the `QWizard`, or -1 if there is no such page.

  By reimplementing this function, you can specify a dynamic page order. For example:

          int IntroPage::nextId() const
          {
              if (evaluateRadioButton->isChecked()) {
                  return LicenseWizard::Page_Evaluate;
              } else {
                  return LicenseWizard::Page_Register;
              }
          }

  See Also:
    `QWizard::nextId`

### validatePage

    public boolean validatePage()

  This virtual function is called by QWizard::validateCurrentPage() when the user clicks Next or Finish to perform some last-minute validation. If it returns true, the next page is shown (or the wizard finishes); otherwise, the current page stays up.

  The default implementation returns true.

  When possible, it is usually better style to disable the Next or Finish button (by specifying mandatory fields or reimplementing `isComplete`) than to reimplement `validatePage`.

  See Also:
    `QWizard::validateCurrentPage`, `isComplete`

### fromNativePointer

    public static QWizardPage fromNativePointer(QNativePointer nativePointer)

  This function returns the QWizardPage instance pointed to by nativePointer

  Parameters:
    `nativePointer` - the QNativePointer of which object should be returned.

### registerField

    protected final void registerField(java.lang.String name,
                                       QWidget widget)

  Creates a field called `name` associated with the given property of the given widget. From then on, that property becomes accessible using `field()` and `setField()`. Fields are global to the entire wizard and make it easy for any single page to access information stored by another page, without having to put all the logic in `QWizard` or having the pages know explicitly about each other. If name ends with an asterisk (*), the field is a mandatory field. When a page has mandatory fields, the Next and/or Finish buttons are enabled only when all mandatory fields are filled. It is required that the widget is of a subclass of one of the following Qt Jambi types: `QAbstractButton` (for which the relevant property is the `checked` property), `QAbstractSlider` (the `value` property), `QComboBox` (`currentIndex` property), `QDateTimeEdit`(`dateTime` property), `QLineEdit`(`text` property), `QListWidget`(`currentRow` property), or `QSpinBox`(`value` property).

  Parameters:
    `name` - The name which will be used to access the field. Names ending with an asterisk signify mandatory fields.
    `widget` - The widget whose property will be accessed using this field.
  See Also:
    `QWizardPage.field(java.lang.String)`, `QWizardPage.setField(java.lang.String, java.lang.Object)`

Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD