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

void QAbstractFormBuilder::save ( QIODevice device,
QWidget widget 
) [virtual, inherited]

Saves an XML representation of the given widget to the specified device in the standard {.ui} file format.

See also:
load()

Definition at line 992 of file abstractformbuilder.cpp.

References QDomNode::appendChild(), QHash< Key, T >::clear(), QAbstractFormBuilder::createDom(), QAbstractFormBuilder::saveDom(), QByteArray::size(), QDomDocument::toString(), QString::toUtf8(), and QIODevice::write().

{
    DomWidget *ui_widget = createDom(widget, 0);
    Q_ASSERT( ui_widget != 0 );

    DomUI *ui = new DomUI();
    ui->setAttributeVersion(QLatin1String("4.0"));
    ui->setElementWidget(ui_widget);

    saveDom(ui, widget);

    QDomDocument doc;
    doc.appendChild(ui->write(doc));
    QByteArray bytes = doc.toString().toUtf8();
    dev->write(bytes, bytes.size());

    m_laidout.clear();

    delete ui;
}


Generated by  Doxygen 1.6.0   Back to index