当前位置:网站首页>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 .
边栏推荐
- Advanced operation of MySQL database basic SQL statement tutorial
- Sikuli 基于图形识别的自动化测试技术
- HR export data Excel VBA
- ETL过程中数据精度不准确问题
- 一键安装gcc脚本
- Seurat转h5ad总结
- selenium将元素保存为图片
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
- English grammar_ Adjective / adverb Level 3 - original sentence pattern
- [tcapulusdb knowledge base] Introduction to tcapulusdb system management
猜你喜欢

HR export data Excel VBA

数据库-视图
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction](/img/66/f3ab0514d691967ad88535ae1448c1.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction

【TcaplusDB知识库】TcaplusDB OMS业务人员权限介绍

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

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

Restcloud ETL extraction de données de table de base de données dynamique

刷题笔记(十九)--二叉树:二叉搜索树的修改与构造

AbortController的使用

Redis-集群
随机推荐
Unity C # e-learning (10) -- unitywebrequest (1)
About selenium common. exceptions. Webdriverexception: message: an unknown server side error solution (resolved)
夏令营来啦!!!冲冲冲
【问题解决】新版webots纹理等资源文件加载/下载时间过长
【ceph】CephFS 内部实现(三):快照
RestCloud ETL解决shell脚本参数化
【TcaplusDB知识库】TcaplusDB OMS业务人员权限介绍
一篇博客彻底掌握:粒子滤波 particle filter (PF) 的理论及实践(matlab版)
【TcaplusDB知识库】TcaplusDB系统管理介绍
AbortController的使用
sqlite加载csv文件,并做数据分析
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
编译配置in文件
2022北京石景山区专精特新中小企业申报流程,补贴10-20万
JS handwritten bind, apply, call
RestCloud ETL抽取动态库表数据实践
Learning memory barrier
Inaccurate data accuracy in ETL process
A blog to thoroughly master the theory and practice of particle filter (PF) (matlab version)
刷题笔记(十九)--二叉树:二叉搜索树的修改与构造