kexi

StdWidgetFactory Class Reference

#include <stdwidgetfactory.h>

Inheritance diagram for StdWidgetFactory:

KFormDesigner::WidgetFactory

List of all members.


Detailed Description

Factory for all basic widgets, including Spring (not containers).

Definition at line 53 of file stdwidgetfactory.h.


Public Slots

void editText ()
void editListContents ()

Public Member Functions

 StdWidgetFactory (QObject *parent, const char *name, const QStringList &args)
virtual QWidget * createWidget (const QCString &c, QWidget *p, const char *n, KFormDesigner::Container *container, int options=DefaultOptions)
virtual bool createMenuActions (const QCString &classname, QWidget *w, QPopupMenu *menu, KFormDesigner::Container *container)
virtual bool startEditing (const QCString &classname, QWidget *w, KFormDesigner::Container *container)
virtual bool previewWidget (const QCString &classname, QWidget *widget, KFormDesigner::Container *container)
virtual bool clearWidgetContent (const QCString &classname, QWidget *w)
virtual bool saveSpecialProperty (const QCString &classname, const QString &name, const QVariant &value, QWidget *w, QDomElement &parentNode, QDomDocument &parent)
virtual bool readSpecialProperty (const QCString &classname, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *item)
virtual QValueList< QCString > autoSaveProperties (const QCString &classname)
virtual void setPropertyOptions (KFormDesigner::WidgetPropertySet &buf, const KFormDesigner::WidgetInfo &info, QWidget *w)

Protected Member Functions

virtual bool isPropertyVisibleInternal (const QCString &classname, QWidget *w, const QCString &property, bool isTopLevel)
virtual bool changeText (const QString &newText)
virtual void resizeEditor (QWidget *editor, QWidget *widget, const QCString &classname)
void saveListItem (QListViewItem *item, QDomNode &parentNode, QDomDocument &domDoc)
void readListItem (QDomElement &node, QListViewItem *parent, KListView *listview)

Constructor & Destructor Documentation

StdWidgetFactory::StdWidgetFactory ( QObject *  parent,
const char *  name,
const QStringList &  args 
)

Todo:
Qt designer compatibility: maybe use this class when QLabel has a pixmap set...?

Definition at line 105 of file stdwidgetfactory.cpp.


Member Function Documentation

QWidget * StdWidgetFactory::createWidget ( const QCString &  classname,
QWidget *  parent,
const char *  name,
KFormDesigner::Container container,
int  options = DefaultOptions 
) [virtual]

Creates a widget (and if needed a KFormDesigner::Container).

Returns:
the created widget
Parameters:
classname the classname of the widget, which should get created
parent the parent for the created widget
name the name of the created widget
container the toplevel Container (if a container should get created)
options options for the created widget: orientation and view mode (see CreateWidgetOptions)

Implements KFormDesigner::WidgetFactory.

Definition at line 381 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::createMenuActions ( const QCString &  classname,
QWidget *  w,
QPopupMenu *  menu,
KFormDesigner::Container container 
) [virtual]

This function can be used to add custom items in widget w context menu menu.

Implements KFormDesigner::WidgetFactory.

Definition at line 470 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::startEditing ( const QCString &  classname,
QWidget *  w,
KFormDesigner::Container container 
) [virtual]

Creates (if necessary) an editor to edit the contents of the widget directly in the Form (eg creates a line edit to change the text of a label). classname is the class the widget belongs to, w is the widget to edit and container is the parent container of this widget (to access Form etc.).

Implements KFormDesigner::WidgetFactory.

Definition at line 488 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::previewWidget ( const QCString &  classname,
QWidget *  widget,
KFormDesigner::Container container 
) [virtual]

This function is called just before the Form is previewed. It allows widgets to make changes before switching (ie for a Spring, hiding the cross)

Implements KFormDesigner::WidgetFactory.

Definition at line 460 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::saveSpecialProperty ( const QCString &  classname,
const QString &  name,
const QVariant &  value,
QWidget *  w,
QDomElement &  parentNode,
QDomDocument &  parent 
) [virtual]

This function is called when FormIO finds a property, at save time, that it cannot handle (ie not a normal property). This way you can save special properties, for example the contents of a listbox.

See also:
readSpecialProperty()

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 670 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::readSpecialProperty ( const QCString &  classname,
QDomElement &  node,
QWidget *  w,
KFormDesigner::ObjectTreeItem item 
) [virtual]

This function is called when FormIO finds a property or an unknown element in a .ui file. You can this way load a special property, for example the contents of a listbox.

See also:
saveSpecialProperty()

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 742 of file stdwidgetfactory.cpp.

QValueList< QCString > StdWidgetFactory::autoSaveProperties ( const QCString &  classname  )  [virtual]

You need to return here a list of the properties that should automatically be saved for a widget belonging to classname, and your custom properties (eg "text" for label or button, "contents" for combobox...).

Implements KFormDesigner::WidgetFactory.

Definition at line 910 of file stdwidgetfactory.cpp.

void StdWidgetFactory::setPropertyOptions ( KFormDesigner::WidgetPropertySet &  buf,
const KFormDesigner::WidgetInfo info,
QWidget *  w 
) [virtual]

This method is called after WidgetPropertySet was filled with properties of a widget w, of class defined by info. Default implementation does nothing. Implement this if you need to set options for properties within the set buf.

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 970 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::isPropertyVisibleInternal ( const QCString &  classname,
QWidget *  w,
const QCString &  property,
bool  isTopLevel 
) [protected, virtual]

This function is called when we want to know whether the property should be visible. Implement it in the factory; don't forget to call implementation in the superclass. Default implementation hides "caption", "icon", "sizeIncrement" and "iconText" properties.

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 844 of file stdwidgetfactory.cpp.

bool StdWidgetFactory::changeText ( const QString &  newText  )  [protected, virtual]

Default implementation changes "text" property. You have to reimplement this function for editing inside the Form to work if your widget's property you want to change isn't named "text". This slot is called when the line edit text changes, and you have to make it really change the good property of the widget using changeProperty() (text, or title, etc.).

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 599 of file stdwidgetfactory.cpp.

void StdWidgetFactory::resizeEditor ( QWidget *  editor,
QWidget *  widget,
const QCString &  classname 
) [protected, virtual]

This function is called when the widget is resized, and the editor size needs to be updated.

Reimplemented from KFormDesigner::WidgetFactory.

Definition at line 640 of file stdwidgetfactory.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys