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

Kross

  • Kross
  • FormAssistant
Public Types | Public Slots | Signals | Public Member Functions | List of all members
Kross::FormAssistant Class Reference

#include <form.h>

Inheritance diagram for Kross::FormAssistant:
Inheritance graph
[legend]

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  FaceType
 

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
virtual void back ()
 
virtual void next ()
 

Signals

void backClicked ()
 
void nextClicked ()
 
- Signals inherited from KAssistantDialog
void currentPageChanged (KPageWidgetItem *current, KPageWidgetItem *before)
 
void pageRemoved (KPageWidgetItem *page)
 

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 ()
 
 ~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)
 
KPageWidgetItem * currentPage () const
 
void insertPage (KPageWidgetItem *before, KPageWidgetItem *item)
 
KPageWidgetItem * insertPage (KPageWidgetItem *before, QWidget *widget, const QString &name)
 
bool isAppropriate (KPageWidgetItem *page) const
 
bool isValid (KPageWidgetItem *page) const
 
 KPageDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 
void removePage (KPageWidgetItem *item)
 
void setAppropriate (KPageWidgetItem *page, bool appropriate)
 
void setCurrentPage (KPageWidgetItem *item)
 
void setFaceType (FaceType faceType)
 
void setValid (KPageWidgetItem *page, bool enable)
 

Additional Inherited Members

- Protected Member Functions inherited from KAssistantDialog
 KAssistantDialog (KPageWidget *widget, QWidget *parent=0, Qt::WindowFlags flags=0)
 
 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 ( )
slot

Force page switching.

This will also emit backClicked()

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.

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

Force page switching.

This will also emit nextClicked()

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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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