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

Kross

  • Kross
  • FormAssistant
Public Types | Public Slots | Signals | Public Member Functions
Kross::FormAssistant Class Reference

#include <form.h>

Inheritance diagram for Kross::FormAssistant:
KAssistantDialog KPageDialog KDialog QDialog

List of all members.

Public Types

enum  AssistantButtonCode {
  None = 0x00000000, Help = 0x00000001, Default = 0x00000002, Cancel = 0x00000020,
  Finish = 0x00001000, Next = 0x00002000, Back = 0x00004000, NoDefault = 0x00008000
}
- Public Types inherited from KAssistantDialog
enum  ButtonCode
enum  ButtonPopupMode
enum  CaptionFlag
enum  FaceType
- Public Types inherited from KPageDialog
- Public Types inherited from KDialog

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

Signals

void backClicked ()
void nextClicked ()
- Signals inherited from KAssistantDialog
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 KPageDialog
- Signals inherited from KDialog

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 ()
 ~KDialog ()
 ~KPageDialog ()
KPageWidgetItem * addPage (QWidget *widget, const QString &name)
void addPage (KPageWidgetItem *item)
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 isAppropriate (KPageWidgetItem *page) const
bool isButtonEnabled (ButtonCode id) const
bool isValid (KPageWidgetItem *page) const
 KDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 KPageDialog (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 setAppropriate (KPageWidgetItem *page, bool appropriate)
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 setMainWidget (QWidget *widget)
void setValid (KPageWidgetItem *page, bool enable)
void showButton (ButtonCode id, bool state)
void showButtonSeparator (bool state)
virtual QSize sizeHint () const
- Public Member Functions inherited from KPageDialog
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
bool isButtonEnabled (ButtonCode id) 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 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 setFaceType (FaceType faceType)
void showButton (ButtonCode id, bool state)

Additional Inherited Members

- Public Attributes inherited from KAssistantDialog
 Apply
 AppNameCaption
 Auto
 Close
 DelayedPopup
 Details
 HIGCompliantCaption
 InstantPopup
 List
 ModifiedCaption
 No
 NoCaptionFlags
 Ok
 Plain
 Reset
 Tabbed
 Tree
 Try
 User1
 User2
 User3
 Yes
- Public Attributes inherited from KPageDialog
- Public Attributes inherited from KDialog
- Protected Member Functions inherited from KAssistantDialog
 KAssistantDialog (KPageWidget *widget, QWidget *parent=0, 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 *)
 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)
virtual void showEvent (QShowEvent *event)

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

Definition at line 383 of file form.h.


Member Enumeration Documentation

enum Kross::FormAssistant::AssistantButtonCode
Enumerator:
None 
Help 
Default 
Cancel 
Finish 
Next 
Back 
NoDefault 

Definition at line 388 of file form.h.


Constructor & Destructor Documentation

FormAssistant::FormAssistant ( const QString &  caption)

Definition at line 477 of file form.cpp.

FormAssistant::~FormAssistant ( )
virtual

Definition at line 492 of file form.cpp.


Member Function Documentation

QWidget * FormAssistant::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 532 of file form.cpp.

void FormAssistant::back ( )
virtualslot

Force page switching.

This will also emit backClicked()

Reimplemented from KAssistantDialog.

Definition at line 502 of file form.cpp.

void Kross::FormAssistant::backClicked ( )
signal
QString FormAssistant::currentPage ( ) const
slot
Returns:
the name of the currently selected page. Use the page() method to get the matching page QWidget instance.

Reimplemented from KAssistantDialog.

Definition at line 513 of file form.cpp.

int Kross::FormAssistant::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).

Definition at line 467 of file form.h.

int Kross::FormAssistant::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 474 of file form.h.

bool FormAssistant::isAppropriate ( const QString &  name) const
slot
See also:
KAssistantDialog::isAppropriate()

Definition at line 537 of file form.cpp.

bool FormAssistant::isValid ( const QString &  name) const
slot
See also:
KAssistantDialog::isValid()

Definition at line 548 of file form.cpp.

void FormAssistant::next ( )
virtualslot

Force page switching.

This will also emit nextClicked()

Reimplemented from KAssistantDialog.

Definition at line 507 of file form.cpp.

void Kross::FormAssistant::nextClicked ( )
signal

use it to setAppropriate()

QWidget * FormAssistant::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 527 of file form.cpp.

QString FormAssistant::result ( )
slot
Returns:
the result. The result may for example "Finish" or "Cancel".

Definition at line 560 of file form.cpp.

void FormAssistant::setAppropriate ( const QString &  name,
bool  appropriate 
)
slot
See also:
KAssistantDialog::setAppropriate()

Definition at line 541 of file form.cpp.

bool FormAssistant::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 519 of file form.cpp.

void FormAssistant::setValid ( const QString &  name,
bool  enable 
)
slot
See also:
KAssistantDialog::setValid()

Definition at line 552 of file form.cpp.

void FormAssistant::showHelpButton ( bool  show)
slot

Definition at line 497 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 Tue Jul 23 2013 20:36:46 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.5 API Reference

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