解决 error: no matching member function for call to ‘connect‘

在连接信号槽时,报错error: no matching member function for call to 'connect'

connect(comboBox_com, &QComboBox::highlighted, this, &testOptionUSBRemote::refreshComList);

原因是由于里信号被重载过,同名了,但是参数不一样,就会报这个错误。

Q_SIGNALS:
    void highlighted(int index);
    void highlighted(const QString &);

这种情况下,需要使用旧版语法。

connect(comboBox_com, SIGNAL(highlighted(int)), this, SLOT(refreshComList(int)));
posted @   duapple  阅读(690)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!
点击右上角即可分享
微信分享提示