信号连接信号

#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton_src, SIGNAL(clicked()), ui->pushButton_dst, SIGNAL(clicked()));
    connect(ui->pushButton_dst, SIGNAL(clicked()), this, SLOT(clickedSlot()));
}

Widget::~Widget()
{
    delete ui;
}

void Widget::clickedSlot()
{
    qDebug() << "clickedSlot";
}

20:39:10: Starting ...
clickedSlot
clickedSlot
posted @ 2022-08-01 20:46  thomas_blog  阅读(83)  评论(0编辑  收藏  举报