Qt中sender()函数的用法

你在一个槽里面,调用这个函数,返回的就是你信号来源的对象;
QPushButton *aaaa = new QPushButton(this);
比如 connect(aaaaa, SIGNAL(Click()), this, SLOT(Onaaaaa());

void Onaaaaa(){
QPushButton *ccc = (QPushButton*) sender();
}

这个CCC就是aaaa这个对象来的

猜你喜欢

转载自blog.csdn.net/qq_24936663/article/details/52366425