The QAbstractFormBuilder class provides a default implementation for classes that create user interfaces at run-time. More...
#include <QAbstractFormBuilder>
Inherited by: QFormBuilder.
QAbstractFormBuilder () | |
virtual | ~QAbstractFormBuilder () |
virtual QWidget * | load ( QIODevice * device, QWidget * parent = 0 ) |
virtual void | save ( QIODevice * device, QWidget * widget ) |
void | setWorkingDirectory ( const QDir & directory ) |
QDir | workingDirectory () const |
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"); file.open(QFile::ReadOnly); QWidget *myWidget = builder.load(&file, this); file.close(); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(myWidget); setLayout(layout); }
To override certain aspects of the form builder's behavior, subclass QAbstractFormBuilder and reimplement the relevant virtual functions:
The QFormBuilder class is typically used by custom components and applications that embed Qt Designer. Standalone applications that need to dynamically generate user interfaces at run-time use the QUiLoader, found in the QtUiTools module.
See also QtUiTools Module.
Constructs a new form builder.
Destroys the form builder.
Loads an XML representation of a widget from the given device, and constructs a new widget with the specified parent.
See also save().
Saves an XML representation of the given widget to the specified device in the standard UI file format.
See also load().
Sets the current working directory of the form builder to the specified directory.
See also workingDirectory().
Returns the current working directory of the form builder.
See also setWorkingDirectory().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.