当前位置:网站首页>Binding method of multiple sub control signal slots under QT
Binding method of multiple sub control signal slots under QT
2022-06-26 15:34:00 【A fat yard makes a strong man】
In some software interface development , You need to use the same batch of controls , For example, there are dozens of settings interfaces lineedit Input box , Or many checkbox Control , As shown in the figure below (qt Setting interface of ):
Which set , As long as a control makes changes, it needs to refresh and save parameters in real time , What's the plan ?
1、 If the control has rules , For example, the code uses for loop new The object of , We can do that new Add your slot function to the next loop .
2、 The second situation is separation new The object of , Does every object new All the time coonnect once ? If it is qt designed In the design interface, you can drag in the settings interface ?
In this case, we can use qt Of findChildren function , As shown in the following code :
QList<QCheckBox *> checkboxList = this->findChildren<QCheckBox *>();
for (int i = 0; i < checkboxList.size(); i++)
{
connect(checkboxList[i], &QCheckBox::clicked, this, [=]()
{
// The slot function you need to execute
}
}
Use the function to find all such control objects under the pop-up window , And put it in a pointer linked list , In this way, unified management can be done , For example, the signal slot connection we want .
边栏推荐
- # 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
- 在校生学习生涯总结(2022)
- JS simple deepcopy (Introduction recursion)
- Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
- English grammar_ Adjective / adverb Level 3 - original sentence pattern
- Restcloud ETL resolves shell script parameterization
- Beijing Fangshan District specialized special new small giant enterprise recognition conditions, with a subsidy of 500000 yuan
- 粒子滤波 PF——在机动目标跟踪中的应用(粒子滤波VS扩展卡尔曼滤波)
- 评价——模糊综合评价
- Notes on brushing questions (19) -- binary tree: modification and construction of binary search tree
猜你喜欢

1.会计基础--会计的几大要素(会计总论、会计科目和账户)

Redis cluster

【微信小程序】事件绑定,你搞懂了吗?

【ceph】CephFS 内部实现(三):快照

ETL过程中数据精度不准确问题

【TcaplusDB知识库】TcaplusDB运维单据介绍
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction](/img/05/8ec56393cac534cb5a00c10a1a9f32.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction

About selenium common. exceptions. Webdriverexception: message: an unknown server side error solution (resolved)

# 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
![[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction
随机推荐
北京房山区专精特新小巨人企业认定条件,补贴50万
1.会计基础--会计的几大要素(会计总论、会计科目和账户)
On which platform is it safe to buy shares and open an account? Ask for guidance
Shell script multi process concurrent writing method example (high level cultivation)
Summer camp is coming!!! Chongchongchong
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
Notes on brushing questions (19) -- binary tree: modification and construction of binary search tree
安全Json协议
Cache page keepalive use in Vue
English语法_形容词/副词3级 - 原级句型
【ceph】CephFS 内部实现(三):快照
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
在校生学习生涯总结(2022)
Beijing Fangshan District specialized special new small giant enterprise recognition conditions, with a subsidy of 500000 yuan
【TcaplusDB知识库】TcaplusDB运维单据介绍
Learning memory barrier
[tcapulusdb knowledge base] tcapulusdb system user group introduction
使用RestCloud ETL Shell组件实现定时调度DataX离线任务
Evaluate:huggingface评价指标模块入门详细介绍
[wechat applet] event binding, do you understand?