当前位置:网站首页>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();
}
边栏推荐
- 哪个券商公司网上开户佣金低又安全又可靠
- cJSON 使用详解
- 迷你高尔夫球场:伦敦休闲旅游好去处
- 元宇宙链游系统开发(逻辑开发)丨链游系统开发(详细分析)
- NM02-独立于总线协议的NM模块调用序列图及代码解释
- How to write controller layer code gracefully?
- UE4 用spline畫正圓
- 夜神模擬器+Fiddler抓包測試App
- AI开发调试系列第二弹:多机分布式调测探索之旅
- Meta universe chain game system development (logic development) - chain game system development (detailed analysis)
猜你喜欢

SLC、MLC、TLC 和 QLC NAND SSD 之间的区别:哪个更好?

新加坡暑假旅游攻略:一天玩转新加坡圣淘沙岛

UE4 用spline畫正圓

Please, stop painting star! This has nothing to do with patriotism!

距离度量 —— 杰卡德距离(Jaccard Distance)

Leetcode interview question 16.11 Diving board

又一所双非改考408,会爆冷么?南昌航空大学软件学院

Leetcode(81)——搜索旋转排序数组 II

谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展

Thoroughly understand the point cloud processing tutorial based on open3d!
随机推荐
Leetcode interview question 16.15 Abacus wonderful calculation
开源物联网平台ThingsBoard的安装
Deep neural network Summary
MySQL 关于 only_full_group_by 限制
如何清理废弃pv和其对应的文件夹
Matlab中弧度转角度、角度转弧度
QQmlApplicationEngine
M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )
怎么用ps提取图片颜色分析色彩搭配
The student Tiktok publicized that his alma mater was roast about "reducing the seal of enrollment". Netizen: hahahahahahahaha
Three ways of function parameter transfer in C language
Esp32-c3 introductory tutorial question ⑪ - ESP tls: create_ ssl_ handle failed, tls_ io_ instance->options. trusted_ certs null
QT official example: QT quick controls - Gallery
Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
NM01-独立于总线协议的NM模块功能概述与API定义
A simple PHP personal card issuing program v4.0
徹底搞懂基於Open3D的點雲處理教程!
Basic idea of quick sorting (easy to understand + examples) "suggestions collection"
CDN acceleration and breaking J anti-theft chain function
Redis(6)----对象与数据结构