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

QWidget * QAbstractFormBuilder::create ( DomUI *  ui,
QWidget parentWidget 
) [protected, virtual]

For internal use only.

Reimplemented in QFormBuilder.

Definition at line 200 of file abstractformbuilder.cpp.

References applyTabStops(), createConnections(), createCustomWidgets(), createResources(), QString::isEmpty(), and reset().

Referenced by create(), QFormBuilder::create(), and load().

{
    QFormBuilderExtra *formBuilderPrivate = QFormBuilderExtra::instance(this);
    formBuilderPrivate->clear();
    if (const DomLayoutDefault *def = ui->elementLayoutDefault()) {
        m_defaultMargin = def->hasAttributeMargin() ? def->attributeMargin() : INT_MIN;
        m_defaultSpacing = def->hasAttributeSpacing() ? def->attributeSpacing() : INT_MIN;
    }

    DomWidget *ui_widget = ui->elementWidget();
    if (!ui_widget)
        return 0;

    DomCustomWidgets *domCustomWidgets  = ui->elementCustomWidgets();
    createCustomWidgets(domCustomWidgets);

#ifndef QT_FORMBUILDER_NO_SCRIPT    
    if (domCustomWidgets) {
        foreach(const DomCustomWidget* cw, domCustomWidgets->elementCustomWidget()) {
            if (const DomScript *domScript = cw->elementScript()) {
                const QString script = domScript->text();
                if (!script.isEmpty())
                    formBuilderPrivate->storeCustomWidgetScript(cw->elementClass(), script);            
            }
        }
    }
#endif

    if (QWidget *widget = create(ui_widget, parentWidget)) {
        createConnections(ui->elementConnections(), widget);
        createResources(ui->elementResources());
        applyTabStops(widget, ui->elementTabStops());
        formBuilderPrivate->applyInternalProperties();
        reset();
        formBuilderPrivate->clear();
        return widget;
    }
    formBuilderPrivate->clear();
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index