Kross
Kross::FormDialog Class Reference
The FormDialog class provides access to KDialog objects as top-level containers. More...
#include <form.h>
Inheritance diagram for Kross::FormDialog:

Public Slots | |
QWidget * | addPage (const QString &name, const QString &header=QString(), const QString &iconname=QString()) |
QString | currentPage () const |
int | exec () |
int | exec_loop () |
QWidget * | page (const QString &name) const |
QString | result () |
bool | setButtons (const QString &buttons) |
bool | setButtonText (const QString &button, const QString &text) |
bool | setCurrentPage (const QString &name) |
bool | setFaceType (const QString &facetype) |
void | setMainWidget (QWidget *newMainWidget) |
Public Member Functions | |
FormDialog (const QString &caption) | |
virtual | ~FormDialog () |
Detailed Description
The FormDialog class provides access to KDialog 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") mydialog = forms.createDialog("MyDialog") mydialog.setButtons("Ok|Cancel") mydialog.setFaceType("Plain") #Auto Plain List Tree Tabbed mypage = mydialog.addPage("name","header") mywidget = forms.createWidgetFromUIFile(mypage, ourPath+'/mywidget.ui') mywidget["lineEdit"].setText("some string") if mydialog.exec_loop(): if mydialog.result() == "Ok": print mywidget["lineEdit"].text mydialog.deleteLater()
Definition at line 232 of file form.h.
Constructor & Destructor Documentation
Member Function Documentation
QWidget * FormDialog::addPage | ( | const QString & | name, | |
const QString & | header = QString() , |
|||
const QString & | iconname = QString() | |||
) | [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.
QString FormDialog::currentPage | ( | ) | const [slot] |
- Returns:
- the name of the currently selected page. Use the page() method to get the matching page QWidget instance.
Reimplemented from KPageDialog.
int Kross::FormDialog::exec | ( | ) | [inline, slot] |
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. "Ok" pressed) else the user rejected the dialog (e.g. by pressing "Cancel" or just closing the dialog by pressing the escape-key).
int Kross::FormDialog::exec_loop | ( | ) | [inline, slot] |
QString FormDialog::result | ( | ) | [slot] |
Set the buttons.
- Parameters:
-
buttons string that defines the displayed buttons. For example the string may look like "Ok" or "Ok|Cancel" or "Yes|No|Cancel".
- Returns:
- true if the passed
buttons
string was valid and setting the buttons was successfully else false is returned.
Set the text of a button.
Sample how to change the buttons of a dialog;
dialog.setButtons("Yes|No|Cancel") dialog.setButtonText("Yes","Overwrite") dialog.setButtonText("No","Skip") dialog.setButtonText("Cancel","Abort")
- Parameters:
-
button string that defines the button that should be changed. text string that should be used as button text.
- Returns:
- true if the passed
buttons
string was valid and setting the button text was successfully else false is returned.
Set the face type of the dialog.
- Parameters:
-
facetype the face type which could be "Auto", "Plain", "List", "Tree" or "Tabbed" as defined in KPageView::FaceType .
void FormDialog::setMainWidget | ( | QWidget * | newMainWidget | ) | [slot] |
Set the newMainWidget
QWidget as main widget.
This is only needed if you like to replace the KPageDialog page-widget with your own widget.
Reimplemented from KDialog.
The documentation for this class was generated from the following files: