#include "widget1.h" Widget1::Widget1(QWidget *parent) : QWidget(parent) { setWindowTitle("题目1"); setFixedSize(800,600); btn = new QPushButton("按钮",this); btn->setFixedSize(200,100); btn->move(10,10); connect(btn,&QPushButton::clicked,[&]()->void{ qDebug()<<"I Love Qt5 Widget"; }); }