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

Kross

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

#include <form.h>

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

Public Slots

QWidget * addPage (const QString &name, const QString &header=QString(), const QString &iconname=QString())
 
QString currentPage () const
 
int exec ()
 
int exec_loop ()
 
QWidget * page (const QString &name) const
 
QString result ()
 
bool setButtons (const QString &buttons)
 
bool setButtonText (const QString &button, const QString &text)
 
bool setCurrentPage (const QString &name)
 
bool setFaceType (const QString &facetype)
 
void setMainWidget (QWidget *newMainWidget)
 

Public Member Functions

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

Detailed Description

The FormDialog class provides access to KDialog 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")
mydialog = forms.createDialog("MyDialog")
mydialog.setButtons("Ok|Cancel")
mydialog.setFaceType("Plain") #Auto Plain List Tree Tabbed
mypage = mydialog.addPage("name","header")
mywidget = forms.createWidgetFromUIFile(mypage, ourPath+'/mywidget.ui')
mywidget["lineEdit"].setText("some string")
if mydialog.exec_loop():
if mydialog.result() == "Ok":
print mywidget["lineEdit"].text
mydialog.deleteLater()

Definition at line 232 of file form.h.

Constructor & Destructor Documentation

FormDialog::FormDialog ( const QString &  caption)

Definition at line 342 of file form.cpp.

FormDialog::~FormDialog ( )
virtual

Definition at line 354 of file form.cpp.

Member Function Documentation

QWidget * FormDialog::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 433 of file form.cpp.

QString FormDialog::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 396 of file form.cpp.

int Kross::FormDialog::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. "Ok" 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 325 of file form.h.

int Kross::FormDialog::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 332 of file form.h.

QWidget * FormDialog::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 410 of file form.cpp.

QString FormDialog::result ( )
slot
Returns
the result. The result may for example "Ok", "Cancel", "Yes" or "No".

Definition at line 443 of file form.cpp.

bool FormDialog::setButtons ( const QString &  buttons)
slot

Set the buttons.

Parameters
buttonsstring that defines the displayed buttons. For example the string may look like "Ok" or "Ok|Cancel" or "Yes|No|Cancel".
Returns
true if the passed buttons string was valid and setting the buttons was successfully else false is returned.

Definition at line 360 of file form.cpp.

bool FormDialog::setButtonText ( const QString &  button,
const QString &  text 
)
slot

Set the text of a button.

Sample how to change the buttons of a dialog;

dialog.setButtons("Yes|No|Cancel")
dialog.setButtonText("Yes","Overwrite")
dialog.setButtonText("No","Skip")
dialog.setButtonText("Cancel","Abort")
Parameters
buttonstring that defines the button that should be changed.
textstring that should be used as button text.
Returns
true if the passed buttons string was valid and setting the button text was successfully else false is returned.

Definition at line 372 of file form.cpp.

bool FormDialog::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 402 of file form.cpp.

bool FormDialog::setFaceType ( const QString &  facetype)
slot

Set the face type of the dialog.

Parameters
facetypethe face type which could be "Auto", "Plain", "List", "Tree" or "Tabbed" as defined in KPageView::FaceType .

Definition at line 384 of file form.cpp.

void FormDialog::setMainWidget ( QWidget *  newMainWidget)
slot

Set the newMainWidget QWidget as main widget.

This is only needed if you like to replace the KPageDialog page-widget with your own widget.

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