【Qt】 No such slot...,No such signal
程序员文章站
2024-01-02 12:38:28
...
绑定槽函数的时候有参数的槽和信号需要指定参数类型的,或者说参数表:
正确
connect(&rev,SIGNAL(on_initBDPMat(int,int,int)),this,SLOT(rec_initBDPMat(int,int,int)));
connect(&rev,SIGNAL(on_BDPpacket(BDP*)),this,SLOT(rec_BDPpacket(BDP*)));
错误:
connect(&rev,SIGNAL(on_initBDPMat()),this,SLOT(rec_initBDPMat()));
connect(&rev,SIGNAL(on_BDPpacket()),this,SLOT(rec_BDPpacket()));
自己类比,代码是自己项目顺手拿过来的。