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) |
Constructor & Destructor Documentation
|
|
Definition at line 93 of file formIO.cpp. |
|
|
Definition at line 97 of file formIO.cpp. |
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 1465 of file formIO.cpp. Referenced by saveWidget(). |
|
|
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 1095 of file formIO.cpp. Referenced by KFormDesigner::FormManager::copyWidget(), and KFormDesigner::DeleteWidgetCommand::DeleteWidgetCommand(). |
|
||||||||||||||||
|
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 1263 of file formIO.cpp. References readChildNodes(), and KFormDesigner::ObjectTreeItem::widget(). Referenced by loadFormFromDom(). |
|
||||||||||||||||||||
|
Loads a form from the src QByteArray.
Definition at line 220 of file formIO.cpp. References loadFormFromDom(). |
|
||||||||||||||||
|
Loads a form from the domDoc QDomDocument. Called by loadForm() and loadFormData().
Definition at line 311 of file formIO.cpp. References KFormDesigner::Form::connectionBuffer(), createToplevelWidget(), KFormDesigner::Form::headerProperties(), KFormDesigner::Form::objectTree(), KFormDesigner::Form::pixmapCollection(), KFormDesigner::Form::setFormatVersion(), KFormDesigner::Form::setOriginalFormatVersion(), KFormDesigner::Form::tabStops(), and KFormDesigner::version(). Referenced by KexiFormView::initForm(), loadFormFromByteArray(), loadFormFromFile(), loadFormFromString(), and KFormDesigner::FormManager::previewForm(). |
|
||||||||||||||||
|
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. References file, and loadFormFromDom(). Referenced by SubForm::setFormName(). |
|
||||||||||||||||||||
|
Definition at line 244 of file formIO.cpp. References loadFormFromDom(). Referenced by KexiReportView::loadForm(), KexiFormView::loadForm(), KexiDBSubForm::setFormName(), and KexiSubReport::setReportName(). |
|
||||||||||||
|
Definition at line 1548 of file formIO.cpp. References len. Referenced by readPropertyValue(). |
|
||||||||||||||||
|
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 1108 of file formIO.cpp. References KFormDesigner::WidgetFactory::DefaultOptions, KFormDesigner::Form::designMode(), KFormDesigner::WidgetFactory::DesignViewMode, KFormDesigner::Container::form(), KFormDesigner::Container::Grid, KFormDesigner::Container::layout(), KFormDesigner::Container::layoutType(), KFormDesigner::Container::objectTree(), readChildNodes(), KFormDesigner::ObjectTreeItem::setGridPos(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), and KFormDesigner::Container::widget(). Referenced by KFormDesigner::PasteWidgetCommand::execute(), readChildNodes(), and KFormDesigner::DeleteWidgetCommand::unexecute(). |
|
||||||||||||||||||||
|
Reads the child nodes of a "widget" element. Definition at line 1311 of file formIO.cpp. References KFormDesigner::Container::form(), KFormDesigner::Container::Grid, KFormDesigner::Container::HBox, KFormDesigner::Container::HFlow, loadWidget(), readPropertyValue(), KexiFlowLayout::setJustified(), KexiFlowLayout::setOrientation(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), KFormDesigner::Container::VBox, and KFormDesigner::Container::VFlow. Referenced by createToplevelWidget(), and loadWidget(). |
|
||||||||||||||||
|
Read an object property in the DOM doc.
Definition at line 737 of file formIO.cpp. References loadImage(), KFormDesigner::Form::pixmapCollection(), KFormDesigner::ObjectTreeItem::setPixmapName(), and KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(). Referenced by readChildNodes(), StdWidgetFactory::readListItem(), StdWidgetFactory::readSpecialProperty(), and ContainerFactory::readSpecialProperty(). |
|
||||||||||||
|
Saves the form inside the dest QByteArray.
Definition at line 134 of file formIO.cpp. References saveFormToDom(). |
|
||||||||||||
|
Save the Form in the domDoc QDomDocument. Called by saveForm().
Definition at line 154 of file formIO.cpp. References saveWidget(). Referenced by KFormDesigner::FormManager::previewForm(), saveFormToByteArray(), saveFormToFile(), and saveFormToString(). |
|
||||||||||||
|
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. References file, KFormDesigner::Form::filename(), saveFormToDom(), and KFormDesigner::Form::setFilename(). |
|
||||||||||||||||
|
Saves the Form to the dest string. indent can be specified to apply indentation.
Definition at line 144 of file formIO.cpp. References saveFormToDom(). Referenced by KexiReportView::beforeSwitchTo(), KexiFormView::beforeSwitchTo(), KFormDesigner::FormManager::showFormUICode(), KexiReportView::storeData(), and KexiFormView::storeData(). |
|
||||||||||||
|
Definition at line 1496 of file formIO.cpp. References len. Referenced by savePropertyValue(). |
|
||||||||||||||||||||||||
|
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 728 of file formIO.cpp. References writeVariant(). Referenced by StdWidgetFactory::saveListItem(), StdWidgetFactory::saveSpecialProperty(), ContainerFactory::saveSpecialProperty(), and saveWidget(). |
|
||||||||||||||||||||||||||||
|
Write an object property in the DOM doc.
Definition at line 401 of file formIO.cpp. References KFormDesigner::ObjectTreeItem::pixmapName(), saveImage(), KFormDesigner::WidgetLibrary::saveSpecialProperty(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), and writeVariant(). Referenced by Spring::saveSpring(), and saveWidget(). |
|
||||||||||||||||||||
|
||||||||||||||||
|
Saves the QVariant value as text to be included in an xml file, with parentNode. Definition at line 477 of file formIO.cpp. Referenced by savePropertyElement(), and savePropertyValue(). |
The documentation for this class was generated from the following files:
