KDE 4.6 PyKDE API Reference

- KDE's Python API

# KPageDialog Class Reference

`from PyKDE4.kdeui import *`

Inherits: KDialog → QDialog → QWidget → QObject
Subclasses: KAssistantDialog, KConfigDialog

## Detailed Description

A dialog base class which can handle multiple pages.

This class provides a dialog base class which handles multiple pages and allows the user to switch between these pages in different ways.

Currently, Auto, Plain, List, Tree and Tabbed face types are available (@see KPageView).

Example:\n

     UrlDialog.UrlDialog( QWidget *parent )
       : KPageDialog( parent )
     {
       setFaceType( List );

       QLabel *label = new QLabel( "Test Page" );
       addPage( label, i18n( "My Test Page" ) );

       label = new QLabel( "Second Test Page" );
       KPageWidgetItem *page = new KPageWidgetItem( label, i18n( "My Second Test Page" ) );
       page->setHeader( i18n( "My header string" ) );
       page->setIcon( KIcon( "file" ) );

       addPage( page );
     }

Author:
  Tobias Koenig (tokoe@kde.org)

## Enumerations

FaceType | { Auto, Plain, List, Tree, Tabbed }

## Signals

| currentPageChanged (KPageWidgetItem current, KPageWidgetItem before)
| pageRemoved (KPageWidgetItem page)

## Methods

| __init__ (self, QWidget parent=0, Qt::WFlags flags=0)
| __init__ (self, KPageWidget widget, QWidget parent, Qt::WFlags flags=0)
KPageWidgetItem | addPage (self, QWidget widget, QString name)
| addPage (self, KPageWidgetItem item)
KPageWidgetItem | addSubPage (self, KPageWidgetItem parent, QWidget widget, QString name)
| addSubPage (self, KPageWidgetItem parent, KPageWidgetItem item)
KPageWidgetItem | currentPage (self)
KPageWidgetItem | insertPage (self, KPageWidgetItem before, QWidget widget, QString name)
| insertPage (self, KPageWidgetItem before, KPageWidgetItem item)
KPageWidget | pageWidget (self)
| removePage (self, KPageWidgetItem item)
| setCurrentPage (self, KPageWidgetItem item)
| setFaceType (self, KPageDialog.FaceType faceType)
| setPageWidget (self, KPageWidget widget)

## Signal Documentation

currentPageChanged | ( | KPageWidgetItem | current,
|  | KPageWidgetItem | before
| ) |  |  |

This signal is emitted whenever the current page has changed.

Parameters:

  | item | The new current page or 0 if no current page is available.

Signal syntax:
  `QObject.connect(source, SIGNAL("currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)"), target_slot)`

pageRemoved | ( | KPageWidgetItem | page
| ) |  |  |

This signal is emitted whenever a page has been removed.

Parameters:

  | page | The page which has been removed

Signal syntax:
  `QObject.connect(source, SIGNAL("pageRemoved(KPageWidgetItem*)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0,
|  | Qt::WFlags | flags=0
| ) |  |  |

Creates a new page dialog.

__init__ | ( | self, |
|  | KPageWidget | widget,
|  | QWidget | parent,
|  | Qt::WFlags | flags=0
| ) |  |  |

This constructor can be used by subclasses to provide a custom page widget.

Parameters:

  | widget | The KPageWidget object will be reparented to this object, so you can create it without parent and you are not allowed to delete it.

KPageWidgetItem addPage | ( | self, |
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Adds a new top level page to the dialog.

Parameters:

  item

  The
  See also:
    KPageWidgetItem which describes the page.

addPage | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Adds a new top level page to the dialog.

Parameters:

  item

  The
  See also:
    KPageWidgetItem which describes the page.

KPageWidgetItem addSubPage | ( | self, |
|  | KPageWidgetItem | parent,
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Inserts a new sub page in the dialog.

Parameters:

  parent

  The new page will be insert as child of this
  See also:
    KPageWidgetItem.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

addSubPage | ( | self, |
|  | KPageWidgetItem | parent,
|  | KPageWidgetItem | item
| ) |  |  |

Inserts a new sub page in the dialog.

Parameters:

  parent

  The new page will be insert as child of this
  See also:
    KPageWidgetItem.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

KPageWidgetItem currentPage | ( |  | self ) |

Returns the

See also:
  KPageWidgetItem for the current page or 0 if there is no current page.

KPageWidgetItem insertPage | ( | self, |
|  | KPageWidgetItem | before,
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Inserts a new page in the dialog.

Parameters:

  before

  The new page will be insert before this
  See also:
    KPageWidgetItem on the same level in hierarchy.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

insertPage | ( | self, |
|  | KPageWidgetItem | before,
|  | KPageWidgetItem | item
| ) |  |  |

Inserts a new page in the dialog.

Parameters:

  before

  The new page will be insert before this
  See also:
    KPageWidgetItem on the same level in hierarchy.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

KPageWidget pageWidget | ( |  | self ) |

Returns the page widget of the dialog or 0 if no page widget is set.

removePage | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Removes the page associated with the given

See also:
  KPageWidgetItem.

setCurrentPage | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Sets the page which is associated with the given

See also:
  KPageWidgetItem to be the current page and emits the currentPageChanged() signal.

setFaceType | ( | self, |
|  | KPageDialog.FaceType | faceType
| ) |  |  |

Sets the face type of the dialog.

setPageWidget | ( | self, |
|  | KPageWidget | widget
| ) |  |  |

Set the page widget of the dialog.

Note:
  the previous pageWidget will be deleted.

Parameters:

  | widget | The KPageWidget object will be reparented to this object, so you can create it without parent and you are not allowed to delete it.

## Enumeration Documentation

FaceType

- Auto - A dialog with a face based on the structure of the
available pages. If only a single page is added, the dialog behaves like in Plain mode, with multiple pages without sub pages it behaves like in List mode and like in Tree mode otherwise.
- Plain - A normal dialog.
- List - A dialog with an icon list on the left side and a
representation of the contents on the right side.
- Tree - A dialog with a tree on the left side and a
representation of the contents on the right side.
- Tabbed - A dialog with a tab bar above the representation
of the contents.

Enumerator:

  Auto |
  Plain |
  List |
  Tree |
  Tabbed |