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

Kross

  • Kross
  • FormModule
Public Slots | Public Member Functions | List of all members
Kross::FormModule Class Reference

#include <form.h>

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

Public Slots

QWidget * activeModalWidget ()
 
QWidget * activeWindow ()
 
QAction * createAction (QObject *parent)
 
QWidget * createAssistant (const QString &caption)
 
QWidget * createDialog (const QString &caption)
 
QWidget * createFileWidget (QWidget *parent, const QString &startDirOrVariable=QString())
 
QObject * createLayout (QWidget *parent, const QString &layout)
 
QWidget * createListView (QWidget *parent)
 
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)
 
QObject * loadPart (QWidget *parent, const QString &name, const QUrl &url=QUrl())
 
QString showMessageBox (const QString &dialogtype, const QString &caption, const QString &message, const QString &details=QString())
 
QWidget * showProgressDialog (const QString &caption, const QString &labelText)
 
QString tr (const QString &str)
 
QString tr (const QString &str, const QString &comment)
 

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 = forms.createWidget(page,"QLabel")
label.text = "Hello World Label"
if dialog.exec_loop():
forms.showMessageBox("Information", "Okay...", "The Ok-button was pressed")

Definition at line 525 of file form.h.

Constructor & Destructor Documentation

FormModule::FormModule ( )
explicit

Definition at line 624 of file form.cpp.

FormModule::~FormModule ( )
virtual

Definition at line 630 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 635 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 640 of file form.cpp.

QAction * FormModule::createAction ( QObject *  parent)
slot

Create and return a new QAction instance.

Parameters
parentthe parent QObject the new QAction instance is a child of.
Returns
the new QAction instance or NULL.

Definition at line 802 of file form.cpp.

QWidget * FormModule::createAssistant ( const QString &  caption)
slot

Create and return a new FormAssistant instance.

Parameters
captionThe displayed caption of the dialog.

Definition at line 689 of file form.cpp.

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

Create and return a new FormDialog instance.

Parameters
captionThe displayed caption of the dialog.

Definition at line 684 of file form.cpp.

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

Create and return a new FormFileWidget instance.

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

Definition at line 786 of file form.cpp.

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

Create and return a new QWidget instance.

Parameters
parentthe parent QWidget the new QWidget is a child of.
layoutthe 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 694 of file form.cpp.

QWidget * FormModule::createListView ( QWidget *  parent)
slot

Create and return a new FormListView instance.

Parameters
parentthe parent QWidget the new FormListView instance is a child of.
Returns
the new FormFileWidget instance or NULL.

Definition at line 794 of file form.cpp.

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

Create and return a new QWidget instance.

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

Definition at line 708 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
parentthe parent QWidget the new QWidget is a child of.
classNamethe name of the class that should be created and returned. For example "QLabel" or "QForm".
namethe objectName the new widget has.
Returns
the new QWidget instance or NULL.

Definition at line 715 of file form.cpp.

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

Create and return a new QWidget instance.

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

Definition at line 734 of file form.cpp.

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

Create and return a new QWidget instance.

Parameters
parentthe parent QWidget the new QWidget is a child of.
filenamethe full filename of the UI file which is readed and its UI XML content is used to construct the new widget.

Definition at line 770 of file form.cpp.

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

Load and return a KPart component.

Parameters
parentThe parent QWidget the KPart's widget will be child of.
nameThe name of the KPart library like e.g. "libkhtmlpart".
urlOptional Url that should be opened on load.

Definition at line 807 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
dialogtypeThe type of the dialog which could be one of the following;
  • Sorry
  • Error
  • Information
  • QuestionYesNo
  • WarningYesNo
  • WarningContinueCancel
  • WarningYesNoCancel
  • QuestionYesNoCancel
captionThe caption the messagedialog displays.
messageThe message that is displayed in the messagedialog.
detailsThe optional details
Returns
The buttoncode which chould be one of the following;
  • Ok
  • Cancel
  • Yes
  • No
  • Continue

Definition at line 645 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
captionThe caption the progressdialog displays.
labelTextThe displayed label.
Returns
The QProgressDialog widget instance.

Definition at line 679 of file form.cpp.

QString FormModule::tr ( const QString &  str)
slot
Returns
i18n'ed version of the string

Definition at line 725 of file form.cpp.

QString FormModule::tr ( const QString &  str,
const QString &  comment 
)
slot
Returns
i18n'ed version of the string, differentiated by the comment text (like '@title:window')

Definition at line 729 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