diff options
Diffstat (limited to 'doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp')
-rw-r--r-- | doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp b/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp new file mode 100644 index 0000000..a88dab5 --- /dev/null +++ b/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp @@ -0,0 +1,26 @@ +//! [0] + 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); + } +//! [0] + + +//! [1] + <!DOCTYPE RCC><RCC version="1.0"> + <qresource prefix="/forms"> + <file>mywidget.ui</file> + </qresource> + </RCC> +//! [1] + + |