qfedu-qt-level/homework-day1/widget5.cpp

25 lines
601 B
C++
Raw Permalink Normal View History

2023-08-08 17:47:59 +08:00
#include "widget5.h"
Widget5::Widget5(QWidget *parent) : QWidget(parent)
{
setWindowTitle("让Widget6消失");
setFixedSize(400,600);
move(400,300);
w6 = new Widget6;
btn = new QPushButton("显示Widget6按钮",this);
btn->setFixedSize(200,100);
btn->move(10,10);
connect(btn,&QPushButton::clicked,[&]()->void{
this->setWindowTitle("让Widget6消失");
w6->show();
});
connect(w6,&Widget6::stealth,[&]()->void{
this->setWindowTitle("Winget6消失了");
w6->close();
});
}