• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kross

Kross::FormAssistant

Kross::FormAssistant Class Reference

The FormAssistant class provides access to KAssistantDialog objects as top-level containers. More...

#include <form.h>

Inheritance diagram for Kross::FormAssistant:

Inheritance graph
[legend]

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

Signals

void backClicked ()
void nextClicked ()

Public Member Functions

 FormAssistant (const QString &caption)
virtual ~FormAssistant ()

Detailed Description

The FormAssistant class provides access to KAssistantDialog objects as top-level containers.

Example (in Python) :

 import Kross
 import sys,os
 ourPath=''
 for p in sys.path:
     if os.path.exists(p+'/mywidget.ui'):
         ourPath=p
         break
 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 391 of file form.h.


Member Enumeration Documentation

enum Kross::FormAssistant::AssistantButtonCode

Enumerator:
None 
Help 
Default 
Cancel 
Finish 
Next 
Back 
NoDefault 

Definition at line 396 of file form.h.


Constructor & Destructor Documentation

FormAssistant::FormAssistant ( const QString &  caption  ) 

Definition at line 478 of file form.cpp.

FormAssistant::~FormAssistant (  )  [virtual]

Definition at line 493 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:
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.

Definition at line 533 of file form.cpp.

void FormAssistant::back (  )  [slot]

Force page switching.

This will also emit backClicked()

Definition at line 503 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.

Definition at line 514 of file form.cpp.

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

int Kross::FormAssistant::exec_loop (  )  [inline, slot]

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 482 of file form.h.

bool FormAssistant::isAppropriate ( const QString &  name  )  const [slot]

See also:
KAssistantDialog::isAppropriate()

Definition at line 538 of file form.cpp.

bool FormAssistant::isValid ( const QString &  name  )  const [slot]

See also:
KAssistantDialog::isValid()

Definition at line 549 of file form.cpp.

void FormAssistant::next (  )  [slot]

Force page switching.

This will also emit nextClicked()

Definition at line 508 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 528 of file form.cpp.

QString FormAssistant::result (  )  [slot]

Returns:
the result. The result may for example "Finish" or "Cancel".

Definition at line 561 of file form.cpp.

void FormAssistant::setAppropriate ( const QString &  name,
bool  appropriate 
) [slot]

See also:
KAssistantDialog::setAppropriate()

Definition at line 542 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 520 of file form.cpp.

void FormAssistant::setValid ( const QString &  name,
bool  enable 
) [slot]

See also:
KAssistantDialog::setValid()

Definition at line 553 of file form.cpp.

void FormAssistant::showHelpButton ( bool  show  )  [slot]

Definition at line 498 of file form.cpp.


The documentation for this class was generated from the following files:
  • form.h
  • form.cpp

Kross

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal