kexi
KFormDesigner::FormIO Class Reference
#include <formIO.h>
Detailed Description
A class to save/load forms from .ui files.
You don't need to create a FormIO object, as all methods are static.
This class is able to read and write Forms to .ui files, and to save each type of properties, including set and enum properties, and pixmaps(pixmap-related code was taken from Qt Designer).
Definition at line 74 of file formIO.h.
Public Member Functions | |
FormIO () | |
~FormIO () | |
Static Public Member Functions | |
static bool | saveFormToDom (Form *form, QDomDocument &domDoc) |
static bool | saveFormToFile (Form *form, const QString &filename=QString::null) |
static bool | saveFormToString (Form *form, QString &dest, int indent=0) |
static bool | saveFormToByteArray (Form *form, QByteArray &dest) |
static bool | loadFormFromDom (Form *form, QWidget *container, QDomDocument &domDoc) |
static bool | loadFormFromByteArray (Form *form, QWidget *container, QByteArray &src, bool preview=false) |
static bool | loadFormFromString (Form *form, QWidget *container, QString &src, bool preview=false) |
static bool | loadFormFromFile (Form *form, QWidget *container, const QString &filename=QString::null) |
static void | saveWidget (ObjectTreeItem *item, QDomElement &parent, QDomDocument &domDoc, bool insideGridLayout=false) |
static void | cleanClipboard (QDomElement &uiElement) |
static void | loadWidget (Container *container, const QDomElement &el, QWidget *parent=0) |
static void | savePropertyElement (QDomElement &parentNode, QDomDocument &domDoc, const QString &tagName, const QString &property, const QVariant &value) |
static QVariant | readPropertyValue (QDomNode node, QObject *obj, const QString &name) |
static void | savePropertyValue (QDomElement &parentNode, QDomDocument &parent, const char *name, const QVariant &value, QWidget *w, WidgetLibrary *lib=0) |
Static Protected Member Functions | |
static void | writeVariant (QDomDocument &parent, QDomElement &parentNode, QVariant value) |
static void | createToplevelWidget (Form *form, QWidget *container, QDomElement &element) |
static QString | saveImage (QDomDocument &domDoc, const QPixmap &pixmap) |
static QPixmap | loadImage (QDomDocument domDoc, const QString &name) |
static void | readChildNodes (ObjectTreeItem *tree, Container *container, const QDomElement &el, QWidget *w) |
static void | addIncludeFileName (const QString &include, QDomDocument &domDoc) |
Member Function Documentation
|
Adds an include file name to be saved in the "includehints" part of .ui file, which is needed by uic. Definition at line 1439 of file formIO.cpp. |
|
Cleans the "UI" QDomElement after saving widget. It deletes the "includes" element not needed when pasting, and make sure all the "widget" elements are at the beginning. Call this after copying a widget, before pasting. Definition at line 1082 of file formIO.cpp. |
|
Creates a toplevel widget from the QDomElement element in the Form form, with parent as parent widget. It calls readPropertyValue() and loadWidget() to load child widgets. Definition at line 1247 of file formIO.cpp. |
|
Loads a form from the src QByteArray.
Definition at line 220 of file formIO.cpp. |
|
Loads a form from the domDoc QDomDocument. Called by loadForm() and loadFormData().
Definition at line 311 of file formIO.cpp. |
|
Loads the .ui file filename in the Form form. If filename is null or not given, a Open File dialog will be shown to select the file to open. createToplevelWidget() is used to load the Form's toplevel widget.
Definition at line 272 of file formIO.cpp. |
|
Definition at line 1522 of file formIO.cpp. |
|
Loads the widget associated to the QDomElement el into the Container container, with parent as parent widget. If parent = 0, the Container::widget() is used as parent widget. This is used to copy/paste widgets. Definition at line 1095 of file formIO.cpp. |
|
Reads the child nodes of a "widget" element. Definition at line 1295 of file formIO.cpp. |
|
Read an object property in the DOM doc.
Definition at line 727 of file formIO.cpp. |
|
Saves the form inside the dest QByteArray.
Definition at line 134 of file formIO.cpp. |
|
Save the Form in the domDoc QDomDocument. Called by saveForm().
Definition at line 154 of file formIO.cpp. |
|
Save the Form form to the file filename. If filename is null or not given, a Save File dialog will be shown to choose dest file.
Definition at line 102 of file formIO.cpp. |
|
Saves the Form to the dest string. indent can be specified to apply indentation.
Definition at line 144 of file formIO.cpp. |
|
Definition at line 1470 of file formIO.cpp. |
|
Save an element in the domDoc as child of parentNode. The element will be saved like this : <$(tagName) name = "$(property)">< value_as_XML ><$(tagName)/>
Definition at line 718 of file formIO.cpp. |
|
Write an object property in the DOM doc.
Definition at line 401 of file formIO.cpp. |
|
Saves the widget associated to the ObjectTreeItem item into DOM document domDoc, with parent as parent node. It calls readPropertyValue() for each object property, readAttribute() for each attribute and itself to save child widgets.
Definition at line 892 of file formIO.cpp. |
|
Saves the QVariant value as text to be included in an xml file, with parentNode. Definition at line 467 of file formIO.cpp. |
The documentation for this class was generated from the following files: