qfedu-basic-level/day11/switchab/bwidget.cpp

17 lines
504 B
C++
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "bwidget.h"
bWidget::bWidget(QWidget *parent) : QWidget(parent)
{
// 新建“返回A”按钮并设置其属性
btnReturnA = new QPushButton("返回A",this);
btnReturnA->resize(60,40);
// 绑定“返回A”按钮点击事件与“发送返回A界面的信号”的槽函数
connect(btnReturnA,&QPushButton::clicked,this,&bWidget::sendReturnASignal);
}
void bWidget::sendReturnASignal()
{
emit returnASignal(); // 触发“返回A界面”信号
}