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

Kross

  • Kross
  • FormAssistant
Public Types | Public Slots | Signals | Public Member Functions

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=(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 ( ) [virtual, slot]

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

Definition at line 513 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 467 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 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 ( ) [virtual, slot]

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

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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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