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

Kross

  • Kross
  • FormDialog
Public Slots | Public Member Functions | List of all members
Kross::FormDialog Class Reference

#include <form.h>

Inheritance diagram for Kross::FormDialog:
KPageDialog KDialog QDialog

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 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)
 

Public Member Functions

 FormDialog (const QString &caption)
 
virtual ~FormDialog ()
 
- 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

- Public Types inherited from KPageDialog
enum  FaceType
 
- Public Types inherited from KDialog
enum  ButtonCode
 
enum  ButtonPopupMode
 
enum  CaptionFlag
 
- 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 ()
 
- 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 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 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()
KPageDialog::List
List
KPageDialog::Tree
Tree
KPageDialog::Tabbed
Tabbed
KPageDialog::Auto
Auto
KPageDialog::Plain
Plain
print
KAction * print(const QObject *recvr, const char *slot, QObject *parent)
Kross
Definition: action.cpp:36

Definition at line 232 of file form.h.

Constructor & Destructor Documentation

◆ FormDialog()

FormDialog::FormDialog ( const QString &  caption)

Definition at line 342 of file form.cpp.

◆ ~FormDialog()

FormDialog::~FormDialog ( )
virtual

Definition at line 354 of file form.cpp.

Member Function Documentation

◆ addPage

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.

◆ currentPage

QString FormDialog::currentPage ( ) const
slot
Returns
the name of the currently selected page. Use the page() method to get the matching page QWidget instance.

Definition at line 396 of file form.cpp.

◆ exec

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.

◆ exec_loop

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.

◆ page

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.

◆ result

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.

◆ setButtons

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.

◆ setButtonText

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.

◆ setCurrentPage

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.

◆ setFaceType

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.

◆ setMainWidget

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.

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-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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