Kross
Kross::FormAssistant Class Reference
#include <form.h>
Inheritance diagram for Kross::FormAssistant:

Public Types | |
enum | AssistantButtonCode { None = 0x00000000 , Help = 0x00000001 , Default = 0x00000002 , Cancel = 0x00000020 , Finish = 0x00001000 , Next = 0x00002000 , Back = 0x00004000 , NoDefault = 0x00008000 } |
Public Types inherited from KPageDialog | |
enum | FaceType |
Public Types inherited from KDialog | |
enum | ButtonCode |
enum | ButtonPopupMode |
enum | CaptionFlag |
Public Slots | |
QWidget * | addPage (const QString &name, const QString &header=QString(), const QString &iconname=QString()) |
void | back () |
QString | currentPage () const |
int | exec () |
int | exec_loop () |
bool | isAppropriate (const QString &name) const |
bool | isValid (const QString &name) const |
void | next () |
QWidget * | page (const QString &name) const |
QString | result () |
void | setAppropriate (const QString &name, bool appropriate) |
bool | setCurrentPage (const QString &name) |
void | setValid (const QString &name, bool enable) |
void | showHelpButton (bool) |
Public Slots inherited from KAssistantDialog | |
virtual void | back () |
virtual void | next () |
Public Slots inherited from KDialog | |
void | delayedDestruct () |
void | enableButton (ButtonCode id, bool state) |
void | enableButtonApply (bool state) |
void | enableButtonCancel (bool state) |
void | enableButtonOk (bool state) |
void | enableLinkedHelp (bool state) |
bool | isDetailsWidgetVisible () const |
virtual void | setCaption (const QString &caption) |
virtual void | setCaption (const QString &caption, bool modified) |
void | setDetailsWidget (QWidget *detailsWidget) |
void | setDetailsWidgetVisible (bool visible) |
void | setHelp (const QString &anchor, const QString &appname=QString()) |
void | setHelpLinkText (const QString &text) |
virtual void | setPlainCaption (const QString &caption) |
Signals | |
void | backClicked () |
void | nextClicked () |
Signals inherited from KPageDialog | |
void | currentPageChanged (KPageWidgetItem *current, KPageWidgetItem *before) |
void | pageRemoved (KPageWidgetItem *page) |
Signals inherited from KDialog | |
void | aboutToShowDetails () |
void | applyClicked () |
void | buttonClicked (KDialog::ButtonCode button) |
void | cancelClicked () |
void | closeClicked () |
void | defaultClicked () |
void | finished () |
void | helpClicked () |
void | hidden () |
void | layoutHintChanged () |
void | noClicked () |
void | okClicked () |
void | resetClicked () |
void | tryClicked () |
void | user1Clicked () |
void | user2Clicked () |
void | user3Clicked () |
void | yesClicked () |
Public Member Functions | |
FormAssistant (const QString &caption) | |
virtual | ~FormAssistant () |
Public Member Functions inherited from KAssistantDialog | |
KAssistantDialog (QWidget *parent=0, Qt::WindowFlags flags=0) | |
virtual | ~KAssistantDialog () |
bool | isAppropriate (KPageWidgetItem *page) const |
bool | isValid (KPageWidgetItem *page) const |
void | setAppropriate (KPageWidgetItem *page, bool appropriate) |
void | setValid (KPageWidgetItem *page, bool enable) |
Public Member Functions inherited from KPageDialog | |
KPageDialog (QWidget *parent=0, Qt::WindowFlags flags=0) | |
~KPageDialog () | |
void | addPage (KPageWidgetItem *item) |
KPageWidgetItem * | addPage (QWidget *widget, const QString &name) |
void | addSubPage (KPageWidgetItem *parent, KPageWidgetItem *item) |
KPageWidgetItem * | addSubPage (KPageWidgetItem *parent, QWidget *widget, const QString &name) |
KPageWidgetItem * | currentPage () const |
void | insertPage (KPageWidgetItem *before, KPageWidgetItem *item) |
KPageWidgetItem * | insertPage (KPageWidgetItem *before, QWidget *widget, const QString &name) |
void | removePage (KPageWidgetItem *item) |
void | setCurrentPage (KPageWidgetItem *item) |
void | setFaceType (FaceType faceType) |
Public Member Functions inherited from KDialog | |
KDialog (QWidget *parent=0, Qt::WindowFlags flags=0) | |
~KDialog () | |
KPushButton * | button (ButtonCode id) const |
KIcon | buttonIcon (ButtonCode id) const |
QString | buttonText (ButtonCode id) const |
QString | buttonToolTip (ButtonCode id) const |
QString | buttonWhatsThis (ButtonCode id) const |
ButtonCode | defaultButton () const |
QString | helpLinkText () const |
void | incrementInitialSize (const QSize &size) |
bool | isButtonEnabled (ButtonCode id) const |
QWidget * | mainWidget () |
virtual QSize | minimumSizeHint () const |
void | restoreDialogSize (const KConfigGroup &config) |
void | saveDialogSize (KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const |
void | setButtonFocus (ButtonCode id) |
void | setButtonGuiItem (ButtonCode id, const KGuiItem &item) |
void | setButtonIcon (ButtonCode id, const KIcon &icon) |
void | setButtonMenu (ButtonCode id, QMenu *menu, ButtonPopupMode popupmode=InstantPopup) |
void | setButtons (ButtonCodes buttonMask) |
void | setButtonsOrientation (Qt::Orientation orientation) |
void | setButtonText (ButtonCode id, const QString &text) |
void | setButtonToolTip (ButtonCode id, const QString &text) |
void | setButtonWhatsThis (ButtonCode id, const QString &text) |
void | setDefaultButton (ButtonCode id) |
void | setEscapeButton (ButtonCode id) |
void | setInitialSize (const QSize &size) |
void | setMainWidget (QWidget *widget) |
void | showButton (ButtonCode id, bool state) |
void | showButtonSeparator (bool state) |
virtual QSize | sizeHint () const |
Additional Inherited Members | |
Static Public Member Functions inherited from KDialog | |
static bool | avoidArea (QWidget *widget, const QRect &area, int screen=-1) |
static void | centerOnScreen (QWidget *widget, int screen=-1) |
static int | groupSpacingHint () |
static QString | makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption) |
static int | marginHint () |
static void | resizeLayout (QLayout *lay, int margin, int spacing) |
static void | resizeLayout (QWidget *widget, int margin, int spacing) |
static void | setAllowEmbeddingInGraphicsView (bool allowEmbedding) |
static int | spacingHint () |
Public Attributes inherited from KPageDialog | |
Auto | |
List | |
Plain | |
Tabbed | |
Tree | |
Public Attributes inherited from KDialog | |
Apply | |
AppNameCaption | |
Cancel | |
Close | |
Default | |
DelayedPopup | |
Details | |
Help | |
HIGCompliantCaption | |
InstantPopup | |
ModifiedCaption | |
No | |
NoCaptionFlags | |
NoDefault | |
None | |
Ok | |
Reset | |
Try | |
User1 | |
User2 | |
User3 | |
Yes | |
Protected Slots inherited from KDialog | |
virtual void | slotButtonClicked (int button) |
void | updateGeometry () |
Protected Member Functions inherited from KAssistantDialog | |
KAssistantDialog (KPageWidget *widget, QWidget *parent=0, Qt::WindowFlags flags=0) | |
virtual void | showEvent (QShowEvent *event) |
Protected Member Functions inherited from KPageDialog | |
KPageDialog (KPageDialogPrivate &dd, KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags=0) | |
KPageDialog (KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags=0) | |
KPageWidget * | pageWidget () |
const KPageWidget * | pageWidget () const |
void | setPageWidget (KPageWidget *widget) |
Protected Member Functions inherited from KDialog | |
KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0) | |
virtual void | closeEvent (QCloseEvent *e) |
virtual void | hideEvent (QHideEvent *) |
virtual void | keyPressEvent (QKeyEvent *) |
Protected Attributes inherited from KDialog | |
KDialogPrivate *const | d_ptr |
Detailed Description
The FormAssistant class provides access to KAssistantDialog objects as top-level containers.
Example (in Python) :
import Kross
import sys,os
ourPath=(filter(lambda p: os.path.exists(p+'/mywidget.ui'),sys.path)+[''])[0]
forms = Kross.module("forms")
myassistant = forms.createAssistant("MyAssistant")
myassistant.showHelpButton(0)
mypage = myassistant.addPage("name","header")
mywidget = forms.createWidgetFromUIFile(mypage, ourPath+'/mywidget.ui')
mypage2 = myassistant.addPage("name2","header2")
mywidget2 = forms.createWidgetFromUIFile(mypage2, ourPath+'/mywidget.ui')
mypage3 = myassistant.addPage("name3","header3")
mywidget3 = forms.createWidgetFromUIFile(mypage3, ourPath+'/mywidget.ui')
mywidget["lineEdit"].setText("some string")
def nextClicked():
myassistant.setAppropriate("name2",0)
def finished():
...
myassistant.deleteLater() #remember to cleanup
myassistant.connect("nextClicked()",nextClicked)
myassistant.connect("finished()",finished)
myassistant.show()
void finished()
void setAppropriate(const QString &name, bool appropriate)
Definition form.cpp:541
Member Enumeration Documentation
◆ AssistantButtonCode
Constructor & Destructor Documentation
◆ FormAssistant()
◆ ~FormAssistant()
Member Function Documentation
◆ addPage
|
slot |
Add and return a new page.
- Parameters
-
name The name the page has. This name is for example returned at the currentPage() method and should be unique. The name is also used to display a short title for the page. header The longer header title text used for display purposes. iconname The name of the icon which the page have. This could be for example "about_kde", "document-open", "configure" or any other iconname known by KDE.
- Returns
- the new QWidget page instance.
◆ back
|
slot |
◆ backClicked
|
signal |
◆ currentPage
|
slot |
◆ exec
|
inlineslot |
Shows the dialog as a modal dialog, blocking until the user closes it and returns the execution result.
- Returns
- >=1 if the dialog was accepted (e.g. "Finished" pressed) else the user rejected the dialog (e.g. by pressing "Cancel" or just closing the dialog by pressing the escape-key).
◆ exec_loop
|
inlineslot |
◆ isAppropriate
|
slot |
◆ isValid
|
slot |
- See also
- KAssistantDialog::isValid()
◆ next
|
slot |
◆ nextClicked
|
signal |
use it to setAppropriate()
◆ page
|
slot |
◆ result
|
slot |
◆ setAppropriate
|
slot |
◆ setCurrentPage
|
slot |
◆ setValid
|
slot |
- See also
- KAssistantDialog::setValid()
◆ showHelpButton
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.