Form1::Form1(QWidget *parent) : QWidget(parent), ui(new Ui::Form1){ ui->setupUi(this); QPushButton * pb = new QPushButton("11111111111",this);}Form1::~Form1(){ delete ui;}void Form1::closeEvent( QCloseEvent * event ){}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); Form1 * f = new Form1(this); f->show();MainWindow::~MainWindow(){ delete ui;}void MainWindow::closeEvent( QCloseEvent * event ){}