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

Kross

  • Kross
  • Kross::FormModule
Public Slots | Public Member Functions

Kross::FormModule Class Reference

The FormModule provides access to UI functionality like dialogs or widgets. More...

#include <form.h>

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

List of all members.

Public Slots

QWidget * activeModalWidget ()
QWidget * activeWindow ()
QString showMessageBox (const QString &dialogtype, const QString &caption, const QString &message, const QString &details=QString())
QWidget * showProgressDialog (const QString &caption, const QString &labelText)
QWidget * createDialog (const QString &caption)
QObject * createLayout (QWidget *parent, const QString &layout)
QWidget * createWidget (const QString &className)
QWidget * createWidget (QWidget *parent, const QString &className, const QString &name=QString())
QWidget * createWidgetFromUI (QWidget *parent, const QString &xml)
QWidget * createWidgetFromUIFile (QWidget *parent, const QString &filename)
QWidget * createFileWidget (QWidget *parent, const QString &startDirOrVariable=QString())
QObject * loadPart (QWidget *parent, const QString &name, const QUrl &url=QUrl())

Public Member Functions

 FormModule ()
virtual ~FormModule ()

Detailed Description

The FormModule provides access to UI functionality like dialogs or widgets.

Example (in Python) :

 import Kross
 forms = Kross.module("forms")
 dialog = forms.createDialog("My Dialog")
 dialog.setButtons("Ok|Cancel")
 page = dialog.addPage("Welcome","Welcome Page","document-open")
 label = self.forms.createWidget("QLabel", page)
 label.text = "Hello World Label"
 if self.dialog.exec_loop():
     forms.showMessageBox("Information", "Okay...", "The Ok-button was pressed")

Definition at line 314 of file form.h.


Constructor & Destructor Documentation

FormModule::FormModule (  )  [explicit]

Definition at line 454 of file form.cpp.

FormModule::~FormModule (  )  [virtual]

Definition at line 460 of file form.cpp.


Member Function Documentation

QWidget * FormModule::activeModalWidget (  )  [slot]
Returns:
the active modal widget. Modal widgets are special top-level widgets which are subclasses of QDialog and are modal.

Definition at line 465 of file form.cpp.

QWidget * FormModule::activeWindow (  )  [slot]
Returns:
the application top-level window that has the keyboard input focus, or NULL if no application window has the focus.

Definition at line 470 of file form.cpp.

QWidget * FormModule::createDialog ( const QString &  caption  )  [slot]

Create and return a new FormDialog instance.

Parameters:
caption The displayed caption of the dialog.

Definition at line 514 of file form.cpp.

QWidget * FormModule::createFileWidget ( QWidget *  parent,
const QString &  startDirOrVariable = QString() 
) [slot]

Create and return a new FormFileWidget instance.

Parameters:
parent the parent QWidget the new FormFileWidget instance is a child of.
startDirOrVariable the start-directory or -variable.
Returns:
the new FormFileWidget instance or NULL.

Definition at line 577 of file form.cpp.

QObject * FormModule::createLayout ( QWidget *  parent,
const QString &  layout 
) [slot]

Create and return a new QWidget instance.

Parameters:
parent the parent QWidget the new QWidget is a child of.
layout the layout style the widget has. This could be one of the following strings;

  • QVBoxLayout
  • QHBoxLayout
  • QStackedLayout
Returns:
the new QLayout instance or NULL.

Definition at line 519 of file form.cpp.

QWidget * FormModule::createWidget ( QWidget *  parent,
const QString &  className,
const QString &  name = QString() 
) [slot]

Create and return a new QWidget instance.

Parameters:
parent the parent QWidget the new QWidget is a child of.
className the name of the class that should be created and returned. For example "QLabel" or "QForm".
name the objectName the new widget has.
Returns:
the new QWidget instance or NULL.

Definition at line 540 of file form.cpp.

QWidget * FormModule::createWidget ( const QString &  className  )  [slot]

Create and return a new QWidget instance.

Parameters:
parent the parent QWidget the new QWidget is a child of.
className the name of the class that should be created and returned. For example "QLabel" or "QForm".
name the objectName the new widget has.
Returns:
the new QWidget instance or NULL.

Definition at line 533 of file form.cpp.

QWidget * FormModule::createWidgetFromUI ( QWidget *  parent,
const QString &  xml 
) [slot]

Create and return a new QWidget instance.

Parameters:
parent the new QWidget is a child of parent.
xml the UI XML string used to construct the new widget.
Returns:
the new QWidget instance or NULL.

Definition at line 549 of file form.cpp.

QWidget * FormModule::createWidgetFromUIFile ( QWidget *  parent,
const QString &  filename 
) [slot]

Create and return a new QWidget instance.

Parameters:
parent the parent QWidget the new QWidget is a child of.
filename the full filename of the UI file which is readed and it's UI XML content is used to construct the new widget.

Definition at line 561 of file form.cpp.

QObject * FormModule::loadPart ( QWidget *  parent,
const QString &  name,
const QUrl &  url = QUrl() 
) [slot]

Load and return a KPart component.

Parameters:
parent The parent QWidget the KPart's widget will be child of.
name The name of the KPart library like e.g. "libkhtmlpart".
url Optional Url that should be opened on load.

Definition at line 585 of file form.cpp.

QString FormModule::showMessageBox ( const QString &  dialogtype,
const QString &  caption,
const QString &  message,
const QString &  details = QString() 
) [slot]

Show a messagebox.

Parameters:
dialogtype The type of the dialog which could be one of the following;

  • Sorry
  • Error
  • Information
  • QuestionYesNo
  • WarningYesNo
  • WarningContinueCancel
  • WarningYesNoCancel
  • QuestionYesNoCancel
caption The caption the messagedialog displays.
message The message that is displayed in the messagedialog.
details The optional details
Returns:
The buttoncode which chould be one of the following;
  • Ok
  • Cancel
  • Yes
  • No
  • Continue

Definition at line 475 of file form.cpp.

QWidget * FormModule::showProgressDialog ( const QString &  caption,
const QString &  labelText 
) [slot]

Show a progressdialog to provide visible feedback on the progress of a slow operation.

Parameters:
caption The caption the progressdialog displays.
labelText The displayed label.
Returns:
The QProgressDialog widget instance.

Definition at line 509 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
  • KJSEmbed
  •   WTF
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.1
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