当前位置:网站首页>QT record of some problems in signal slot connection
QT record of some problems in signal slot connection
2022-04-22 10:24:00 【yinchengkai】
I have met several times in my work connect To connect the signal slot , There are some error reporting problems
1. There is a problem in compiling that no slot function is found
QObject::connect: No such slot UserLogin::Login_Result(bool result,QString msg) in ..\FAWVW_BlueTest\BlueTest\userlogin.cpp:28
QObject::connect: (receiver name: 'UserLogin')
Post my wrong source code
connect(Global::pMesPlatform,SIGNAL(Sign_MesResult(bool ,QString)),this,SLOT(Mes_UpLoadResp(bool result,QString message)));
}
Through help documents , You can see the use of SIGNAL,SLOT When it comes to the way , The signal slot function only needs to fill in the parameter type , Cannot fill in parameters ; So to Mes_UpLoadResp(bool ,QString )

summary : Use connect(sender,SIGNAL(),reciver,SLOT()) Connect the signal slot in the same way , Generally used for overloaded signal slot function , That is, there are multiple functions with the same name but different parameter types or different numbers
If there is no such situation , This is recommended connect The way :

connect(Global::pMesPlatform,&MesPlatform::Sign_MesResult,this,&MainWindow::Mes_UpLoadResp);
版权声明
本文为[yinchengkai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221018008007.html
边栏推荐
- .pm format perl
- shell获取随机数和echo -e '\033[字背景颜色;字体颜色m字符串\033[0m'
- 数字化时代,企业运维面临现状及挑战分析解读
- 頭條面試居然跟我扯了半小時的Semaphore
- 【307期】从实现原理来讲,Nacos 为什么这么强?
- Oracle 11.0 under Windows Upgrade from 2.0.1 to Oracle 11.0 2.0.4
- leetcode771. 宝石与石头
- 柯里化的两种写法(弄懂`fn.length`与`fn.toString()`)
- OneFlow学习笔记:从Functor到OpExprInterpreter
- 004-MYSQL的查询过程
猜你喜欢

numpy库的基础知识介绍与基本使用

oracle19.3升级到19.6

Multi target tracking extended Kalman filter (EKF)

最通俗易懂的依赖注入之服务容器与作用域

Share some unknown and super easy-to-use API functions in sklearn module

5. Embedded controller (EC) learns PS / 2 protocol

Linux Installation Oracle 19C Full Version (graphics + silent installation)

Zhongshanghui ⺠ evolution of trading platform architecture: response to Apache shardingsphere

DPU 芯片头部企业云豹智能加入 openEuler社区,为数字中国基础设施助力

Analysis and interpretation of the current situation and challenges faced by enterprise operation and maintenance in the digital era
随机推荐
.pm format perl
Softing datafeed OPC Suite: empowering industrial equipment to connect to the Internet of things
Golang time strings common methods
.pm format perl
Generalized Robust Regression for Jointly Sparse Subspace Learning
A case of MySQL implicit conversion
SPA首屏加载优化
oracle中時間函數總結
Oracle帐户被锁了解锁方法
Three minute quick understanding of interactive graffiti
004-MYSQL的查询过程
The headline interview actually told me about semaphore for half an hour
Linux 7 silent installation of Oracle 11g
Can Siemens PLC realize wireless communication through Ethernet data module?
启动mongodb时发现错误libcrypto.so.10
formDate保存数据
谷歌AdSense提示广告抓取工具错误,这可能导致收入减少怎么办
全网最详细KaLi系统配置和安装教程,我妈看了都会!
《MySQL 是怎样运行的:从根儿上理解 MySQL 》优质笔记
docker 启动mysql问题,You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQ