当前位置:网站首页>LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
2022-07-02 18:49:00 【Licht powder】
When one Object emit One signal When , It's a sender, The system will record who is currently emit Out of this signal Of , So we can get which signal to send from the corresponding slot function
There could be multiple Object Of signal Will be connected to the same signal( For example, more than one Button May be connect To a slot function onClick()), Therefore, it is necessary to judge which Object emit With this signal, according to sender Different to deal with different
QObject::Sender() Returns the pointer of the object that sent the signal , The return type is QObject *
The following example :
void LightLibCreateWidget::slotEffectCBClicked()
{
// Set selection button
LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());
m_iSelectBtnIndex = sender->getLightIndex();
}
边栏推荐
- 工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座
- 夜神模拟器+Fiddler抓包测试App
- Leetcode 面试题 16.17. 连续数列
- 揭秘得物客服IM全链路通信过程
- paddlepaddle 28 搭建基于卷积的自动编码机
- 再放寬!這些應届生,可直接落戶上海
- 第一次去曼谷旅游怎么玩?这份省钱攻略请收好
- Night God simulator +fiddler packet capture test app
- Leetcode interview question 16.15 Abacus wonderful calculation
- @Component cannot get Dao layer
猜你喜欢
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
Redis(7)----数据库与过期键
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Leetcode interview question 16.15 Abacus wonderful calculation
exness深度好文:动性系列-黄金流动性实例分析(五)
Leetcode(81)——搜索旋转排序数组 II
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
NM01-独立于总线协议的NM模块功能概述与API定义
Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理
材质UV遮罩的技巧
随机推荐
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
Redis(6)----对象与数据结构
paddlepaddle 28 搭建基于卷积的自动编码机
SAP S/4HANA OData Mock Service 介绍
300+ documents! This article explains the latest progress of multimodal learning based on transformer
PR曲线和ROC曲线概念及其区别
Radian to angle, angle to radian in MATLAB
Qt官方示例:Qt Quick Controls - Gallery
Server PHP environment building tutorial, PHP server environment building graphic explanation
Redis (6) -- object and data structure
再放宽!这些应届生,可直接落户上海
彻底搞懂基于Open3D的点云处理教程!
Chrome officially supports MathML, which is enabled in chromium dev 105 by default
In early summer, Kaiyuan magic changed an electric mosquito racket with killing sound effect!
NM01-独立于总线协议的NM模块功能概述与API定义
SLAM|如何时间戳对齐?
Unity学习shader笔记[八十一]简单的颜色调整后处理(亮度,饱和度,对比度)
第一次去曼谷旅游怎么玩?这份省钱攻略请收好
The difference between promise and observable
Industrial software lecture - core technology analysis of 3D CAD design software - the second lecture of the Forum