The QFormBuilder class is used to dynamically construct user interfaces from UI files at run-time. More...
#include <QFormBuilder>
Inherits: QAbstractFormBuilder.
QFormBuilder () | |
virtual | ~QFormBuilder () |
void | addPluginPath ( const QString & pluginPath ) |
void | clearPluginPaths () |
QList<QDesignerCustomWidgetInterface *> | customWidgets () const |
QStringList | pluginPaths () const |
void | setPluginPath ( const QStringList & pluginPaths ) |
The QFormBuilder class is used to dynamically construct user interfaces from UI files at run-time.
The QFormBuilder class provides a mechanism for dynamically creating user interfaces at run-time, based on UI files created with Qt Designer. 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); }
By including the user interface in the example's resources (myForm.qrc), we ensure that it will be present when the example is run:
<!DOCTYPE RCC><RCC version="1.0"> <qresource prefix="/forms"> <file>mywidget.ui</file> </qresource> </RCC>
QFormBuilder extends the QAbstractFormBuilder base class with a number of functions that are used to support custom widget plugins:
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 class, found in the QtUiTools module.
See also QAbstractFormBuilder and QtUiTools Module.
Constructs a new form builder.
Destroys the form builder.
Adds a new plugin path specified by pluginPath to the list of paths that will be searched by the form builder when loading a custom widget plugin.
See also setPluginPath() and clearPluginPaths().
Clears the list of paths that the form builder uses to search for custom widget plugins.
See also pluginPaths().
Returns a list of the available plugins.
Returns the list of paths the form builder searches for plugins.
See also addPluginPath().
Sets the list of plugin paths to the list specified by pluginPaths.
See also addPluginPath().
© 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.