信号与槽(signal and slot)成功连接的前提条件

来源:互联网 发布:淘宝加入购物车源代码 编辑:程序博客网 时间:2024/05/16 10:19

1)信号与槽函数必须有相同的参数类型,且参数类型顺序要相同:

connect(ftp, SIGNAL(rawCommandReply(int, const QString&)),

                  this, SLOT(processReply(int, const QString&)));

2)如果信号比槽的参数多,则多的参数将被忽略

connect(ftp, SIGNAL(rawCommandReply(int, const QString&)),

                  this, SLOT(processReply(int)));



原创粉丝点击