Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QAbstractFormBuilder Class Reference

Inheritance diagram for QAbstractFormBuilder:


List of all members.

Detailed Description

The QAbstractFormBuilder class provides a default implementation for classes that create user interfaces at run-time.


QAbstractFormBuilder provides a standard interface and a default implementation for constructing forms from user interface files. It is not intended to be instantiated directly. Use the QFormBuilder class to create user interfaces from {.ui} files at run-time. For example:

        MyForm::MyForm(QWidget *parent)
            : QWidget(parent)
            QFormBuilder builder;
            QFile file(":/forms/myWidget.ui");
            QWidget *myWidget = builder.load(&file, this);

            QVBoxLayout *layout = new QVBoxLayout;

To override certain aspects of the form builder's behavior, subclass QAbstractFormBuilder and reimplement the relevant virtual functions:

load() handles reading of {.ui} format files from arbitrary QIODevices, and construction of widgets from the XML data that they contain. save() handles saving of widget details in {.ui} format to arbitrary QIODevices. workingDirectory() and setWorkingDirectory() control the directory in which forms are held. The form builder looks for other resources on paths relative to this directory.

The QFormBuilder class is typically used by custom components and applications that embed . Standalone applications that need to dynamically generate user interfaces at run-time use the QUiLoader, found in the QtUiTools module.

See also:
{QtUiTools Module}

Definition at line 77 of file abstractformbuilder.h.

Public Member Functions

virtual QWidgetload (QIODevice *dev, QWidget *parentWidget=0)
 QAbstractFormBuilder ()
virtual void save (QIODevice *dev, QWidget *widget)
void setWorkingDirectory (const QDir &directory)
QDir workingDirectory () const
virtual ~QAbstractFormBuilder ()

Protected Member Functions

virtual bool addItem (DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
virtual bool addItem (DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout)
virtual void addMenuAction (QAction *action)
virtual void applyProperties (QObject *o, const QList< DomProperty * > &properties)
virtual void applyTabStops (QWidget *widget, DomTabStops *tabStops)
virtual bool checkProperty (QObject *obj, const QString &prop) const
virtual QList< DomProperty * > computeProperties (QObject *obj)
virtual QActionGroupcreate (DomActionGroup *ui_action_group, QObject *parent)
virtual QActioncreate (DomAction *ui_action, QObject *parent)
virtual QLayoutItemcreate (DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget)
virtual QLayoutcreate (DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget)
virtual QWidgetcreate (DomWidget *ui_widget, QWidget *parentWidget)
virtual QWidgetcreate (DomUI *ui, QWidget *parentWidget)
virtual QActioncreateAction (QObject *parent, const QString &name)
virtual QActionGroupcreateActionGroup (QObject *parent, const QString &name)
virtual DomActionRef * createActionRefDom (QAction *action)
virtual void createConnections (DomConnections *, QWidget *)
virtual void createCustomWidgets (DomCustomWidgets *)
virtual DomActionGroup * createDom (QActionGroup *actionGroup)
virtual DomAction * createDom (QAction *action)
virtual DomSpacer * createDom (QSpacerItem *spacer, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget)
virtual DomLayoutItem * createDom (QLayoutItem *item, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget)
virtual DomLayout * createDom (QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget)
virtual DomWidget * createDom (QWidget *widget, DomWidget *ui_parentWidget, bool recursive=true)
virtual QLayoutcreateLayout (const QString &layoutName, QObject *parent, const QString &name)
virtual DomProperty * createProperty (QObject *object, const QString &propertyName, const QVariant &value)
virtual void createResources (DomResources *)
virtual QWidgetcreateWidget (const QString &widgetName, QWidget *parentWidget, const QString &name)
virtual QString iconToFilePath (const QIcon &pm) const
virtual QString iconToQrcPath (const QIcon &pm) const
virtual void layoutInfo (DomLayout *layout, QObject *parent, int *margin, int *spacing)
void loadComboBoxExtraInfo (DomWidget *ui_widget, QComboBox *comboBox, QWidget *parentWidget)
virtual void loadExtraInfo (DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
void loadListWidgetExtraInfo (DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget)
void loadTableWidgetExtraInfo (DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget)
void loadTreeWidgetExtraInfo (DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget)
virtual QIcon nameToIcon (const QString &filePath, const QString &qrcPath)
virtual QPixmap nameToPixmap (const QString &filePath, const QString &qrcPath)
virtual QString pixmapToFilePath (const QPixmap &pm) const
virtual QString pixmapToQrcPath (const QPixmap &pm) const
void reset ()
DomColorGroup * saveColorGroup (const QPalette &palette)
void saveComboBoxExtraInfo (QComboBox *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
virtual DomConnections * saveConnections ()
virtual DomCustomWidgets * saveCustomWidgets ()
virtual void saveDom (DomUI *ui, QWidget *widget)
virtual void saveExtraInfo (QWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
void saveListWidgetExtraInfo (QListWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
virtual DomResources * saveResources ()
void saveTableWidgetExtraInfo (QTableWidget *tablWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
virtual DomTabStops * saveTabStops ()
void saveTreeWidgetExtraInfo (QTreeWidget *treeWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
void setupColorGroup (QPalette &palette, QPalette::ColorGroup colorGroup, DomColorGroup *group)
QVariant toVariant (const QMetaObject *meta, DomProperty *property)

Static Protected Member Functions

static QHash< QString,
DomProperty * > 
propertyMap (const QList< DomProperty * > &properties)
static bool toBool (const QString &str)
static QString toString (const DomString *str)

Protected Attributes

QHash< QString, QActionGroup * > m_actionGroups
QHash< QString, QAction * > m_actions
int m_defaultMargin
int m_defaultSpacing
QHash< QObject *, bool > m_laidout
QDir m_workingDirectory

Private Member Functions

void operator= (const QAbstractFormBuilder &other)
 QAbstractFormBuilder (const QAbstractFormBuilder &other)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index