KPageDialog Class Reference
from PyKDE5.kwidgetsaddons import *
Inherits: QDialog → QWidget → QObject
Subclasses: KAssistantDialog
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( QIcon.fromTheme( "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::WindowFlags flags=0) |
| __init__ (self, KPageWidget widget, QWidget parent, Qt::WindowFlags 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) |
QPushButton | button (self, QDialogButtonBox::StandardButton which) |
QDialogButtonBox | buttonBox (self) |
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) |
| setButtonBox (self, QDialogButtonBox box) |
| setCurrentPage (self, KPageWidgetItem item) |
| setFaceType (self, KPageDialog::FaceType faceType) |
| setPageWidget (self, KPageWidget widget) |
| setStandardButtons (self, QDialogButtonBox::StandardButtons buttons) |
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
Creates a new page dialog.
__init__ |
( |
self, |
|
|
|
KPageWidget |
widget, |
|
|
QWidget |
parent, |
|
|
Qt::WindowFlags |
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.
QPushButton button |
( |
self, |
|
|
|
QDialogButtonBox::StandardButton |
which |
|
) |
|
|
|
Returns the QPushButton corresponding to the standard button which, or 0 if the standard
button doesn't exist in this dialog.
QDialogButtonBox buttonBox |
( |
|
self ) |
|
Returns the button box of the dialog or 0 if no button box is set.
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.
setButtonBox |
( |
self, |
|
|
|
QDialogButtonBox |
box |
|
) |
|
|
|
Set the button box of the dia.log
- Note:
- the previous buttonBox will be deleted.
- Parameters:
-
| box | The QDialogButtonBox object will be reparented to this objectm so you can create
it without parent and you are not allowed to delete it.
|
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.
|
setStandardButtons |
( |
self, |
|
|
|
QDialogButtonBox::StandardButtons |
buttons |
|
) |
|
|
|
Sets the collection of standard buttons displayed by this dialog.
Enumeration Documentation
- 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 | |
|
|
|
|
|
|
|
|
|
|