• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.4 API Reference
  • KDE Home
  • Contact Us
 

Kross

  • Kross
  • FormDialog
Public Slots | Public Member Functions
Kross::FormDialog Class Reference

#include <form.h>

Inheritance diagram for Kross::FormDialog:
KPageDialog KDialog QDialog

List of all members.

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 Slots inherited from KPageDialog
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)
- Public Slots inherited from KDialog

Public Member Functions

 FormDialog (const QString &caption)
virtual ~FormDialog ()
- Public Member Functions inherited from KPageDialog
 KPageDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 ~KDialog ()
 ~KPageDialog ()
void addPage (KPageWidgetItem *item)
KPageWidgetItem * addPage (QWidget *widget, const QString &name)
KPageWidgetItem * addSubPage (KPageWidgetItem *parent, QWidget *widget, const QString &name)
void addSubPage (KPageWidgetItem *parent, KPageWidgetItem *item)
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)
KPageWidgetItem * insertPage (KPageWidgetItem *before, QWidget *widget, const QString &name)
void insertPage (KPageWidgetItem *before, KPageWidgetItem *item)
bool isButtonEnabled (ButtonCode id) const
 KDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
QWidget * mainWidget ()
virtual QSize minimumSizeHint () const
void removePage (KPageWidgetItem *item)
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 setCurrentPage (KPageWidgetItem *item)
void setDefaultButton (ButtonCode id)
void setEscapeButton (ButtonCode id)
void setFaceType (FaceType faceType)
void setInitialSize (const QSize &size)
void showButton (ButtonCode id, bool state)
void showButtonSeparator (bool state)
virtual QSize sizeHint () const

Additional Inherited Members

- Public Types inherited from KPageDialog
enum  ButtonCode
enum  ButtonPopupMode
enum  CaptionFlag
enum  FaceType
- Public Types inherited from KDialog
- Signals inherited from KPageDialog
void aboutToShowDetails ()
void applyClicked ()
void buttonClicked (KDialog::ButtonCode button)
void cancelClicked ()
void closeClicked ()
void currentPageChanged (KPageWidgetItem *current, KPageWidgetItem *before)
void defaultClicked ()
void finished ()
void helpClicked ()
void hidden ()
void layoutHintChanged ()
void noClicked ()
void okClicked ()
void pageRemoved (KPageWidgetItem *page)
void resetClicked ()
void tryClicked ()
void user1Clicked ()
void user2Clicked ()
void user3Clicked ()
void yesClicked ()
- Signals inherited from KDialog
- Static Public Member Functions inherited from KPageDialog
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
 Apply
 AppNameCaption
 Auto
 Cancel
 Close
 Default
 DelayedPopup
 Details
 Help
 HIGCompliantCaption
 InstantPopup
 List
 ModifiedCaption
 No
 NoCaptionFlags
 NoDefault
 None
 Ok
 Plain
 Reset
 Tabbed
 Tree
 Try
 User1
 User2
 User3
 Yes
- Public Attributes inherited from KDialog
- Protected Slots inherited from KPageDialog
void updateGeometry ()
- Protected Slots inherited from KDialog
- Protected Member Functions inherited from KPageDialog
 KPageDialog (KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags=0)
 KPageDialog (KPageDialogPrivate &dd, KPageWidget *widget, QWidget *parent, Qt::WindowFlags flags=0)
virtual void closeEvent (QCloseEvent *e)
virtual void hideEvent (QHideEvent *)
 KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0)
virtual void keyPressEvent (QKeyEvent *)
const KPageWidget * pageWidget () const
KPageWidget * pageWidget ()
void setPageWidget (KPageWidget *widget)
- Protected Attributes inherited from KPageDialog
KDialogPrivate *const d_ptr
- Protected Attributes inherited from KDialog

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

FormDialog::FormDialog ( const QString &  caption)

Definition at line 342 of file form.cpp.

FormDialog::~FormDialog ( )
virtual

Definition at line 354 of file form.cpp.


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:
nameThe 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.
headerThe longer header title text used for display purposes.
iconnameThe 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.

Definition at line 433 of file form.cpp.

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.

Definition at line 396 of file form.cpp.

int Kross::FormDialog::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. "Ok" pressed) else the user rejected the dialog (e.g. by pressing "Cancel" or just closing the dialog by pressing the escape-key).

Definition at line 325 of file form.h.

int Kross::FormDialog::exec_loop ( )
inlineslot

Same as the exec() method above provided for Python-lovers (python does not like functions named "exec" and PyQt named it "exec_loop", so just let's do the same).

Definition at line 332 of file form.h.

QWidget * FormDialog::page ( const QString &  name) const
slot
Returns:
the QWidget page instance which has the pagename name or NULL if there exists no such page.

Definition at line 410 of file form.cpp.

QString FormDialog::result ( )
slot
Returns:
the result. The result may for example "Ok", "Cancel", "Yes" or "No".

Definition at line 443 of file form.cpp.

bool FormDialog::setButtons ( const QString &  buttons)
slot

Set the buttons.

Parameters:
buttonsstring 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.

Definition at line 360 of file form.cpp.

bool FormDialog::setButtonText ( const QString &  button,
const QString &  text 
)
slot

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:
buttonstring that defines the button that should be changed.
textstring 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.

Definition at line 372 of file form.cpp.

bool FormDialog::setCurrentPage ( const QString &  name)
slot

Set the current page to name .

If there exists no page with such a pagename the method returns false else (if the page was successfully set) true is returned.

Definition at line 402 of file form.cpp.

bool FormDialog::setFaceType ( const QString &  facetype)
slot

Set the face type of the dialog.

Parameters:
facetypethe face type which could be "Auto", "Plain", "List", "Tree" or "Tabbed" as defined in KPageView::FaceType .

Definition at line 384 of file form.cpp.

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 KPageDialog.

Definition at line 438 of file form.cpp.


The documentation for this class was generated from the following files:
  • form.h
  • form.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 12:08:15 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.4 API Reference

Skip menu "kdelibs-4.10.4 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal