Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.6.2
-
None
-
winvista vs2008sp1
Description
there is a big bug in QFormBuilder.
if save a complexWidget(like QTextEdit ,QTableView etc) , it will save all children of the complexWidget as a sampleWidget(like qscrollbar widget etc).
src:
--------------------------------------------------------
mywindow.h
#include <QDialog>
#include <QCloseEvent>
class QVBoxLayout;
class QLineEdit;
class MyWindow:public QDialog
{
Q_OBJECT
public:
MyWindow(QWidget *parent = 0);
protected:
QLineEdit *le;
QVBoxLayout *v1;
void closeEvent ( QCloseEvent * event ) ;
};
---------------------------------------------------------
mywindow.cpp
MyWindow::MyWindow(QWidget *parent )
:QDialog(parent)
{
QTextEdit *te = new QTextEdit;
v1 = new QVBoxLayout;
v1->addWidget(te);
this->setLayout(v1);
}
void MyWindow::closeEvent ( QCloseEvent * e )
{
QFormBuilder builder;
QFile file("./myWndow.ui");
file.open(QFile::WriteOnly);
builder.save(&file,this);
QDialog::closeEvent(e);
}