#include "widget.h"
#include "ui_widget.h"
#include"testwinget.h"
#include"testdialog.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
#if 0 //Dialog 窗口的焦点可以随意切换 有两种显示模式 模态和非模态
// Dialog窗口 不管有没有指定this都不会内嵌到父窗口中
TestDialog* w=new TestDialog(this);
#else
TestDialog* w=new TestDialog(this);//TestDialog* w=new TestDialog(this)
//new的时候没有有this 都无所谓
//w->show();非模态显示
//模态,exec()阻塞程序的执行
w->exec();//阻塞在exec函数上 使父窗口不能执行
#endif
}
Widget::~Widget()
{
delete ui;
}