当前位置:网站首页>QT realizes signal transmission and reception between two windows
QT realizes signal transmission and reception between two windows
2022-07-05 09:55:00 【Sunqk5665】
It mainly uses the correlation implementation method of signal and slot
1、 Implementation process
1、 Create a new one Widget, And then build another one QMainWindow.
2、 stay mainwindow.h Custom signal in header file , Use it when declaring signals keyword , stay public、private and protect And so on , Because the signal defaults to public function .
3、 stay mianwindow.ui Add spinbox And a button.
4、 Then go to pushbutton The slot corresponding to the stand-alone signal of , Add the function code as follows :
So click the button to get spinBox The value in , And send the obtained value . It is actually sent to memory , Wait for the slot function to get .
5、 stay widget.h Add a custom slot declaration in the header file :
6、 And then in widget.ui Drag in a Lable, Used to receive the previously sent value .
7、 I'll see you next widget.cpp The implementation of custom slots in the source file , Is to capture the signal transmitted in front , Display values in lable in .
8、 The next in widget.cpp Associate the signal with the slot in the source file .
2、 Running effect



边栏推荐
- The comparison of every() and some() in JS uses a power storage plan
- Tdengine already supports the industrial Intel edge insight package
- 干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
- Community group buying exploded overnight. How should this new model of e-commerce operate?
- E-commerce apps are becoming more and more popular. What are the advantages of being an app?
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
- 百度智能小程序巡检调度方案演进之路
- Android SQLite database encryption
- 初识结构体
- Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
猜你喜欢

How to correctly evaluate video image quality

解决Navicat激活、注册时候出现No All Pattern Found的问题

mysql80服务不启动

美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...

植物大战僵尸Scratch

La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu

SQL learning - case when then else

Apache DolphinScheduler 入门(一篇就够了)

H. 265 introduction to coding principles

小程序启动性能优化实践
随机推荐
【C语言】动态内存开辟的使用『malloc』
How to use sqlcipher tool to decrypt encrypted database under Windows system
Three-level distribution is becoming more and more popular. How should businesses choose the appropriate three-level distribution system?
[hungry dynamic table]
Lepton 无损压缩原理及性能分析
一文读懂TDengine的窗口查询功能
百度智能小程序巡检调度方案演进之路
MYSQL 对字符串类型排序不生效问题
Tdengine offline upgrade process
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
From "chemist" to developer, from Oracle to tdengine, two important choices in my life
Unity skframework framework (XXIII), minimap small map tool
Flutter development: a way to solve the problem of blank space on the top of listview
.Net之延迟队列
7 月 2 日邀你来TD Hero 线上发布会
SMT32H7系列DMA和DMAMUX的一点理解
Develop and implement movie recommendation applet based on wechat cloud
植物大战僵尸Scratch
LeetCode 556. Next bigger element III
Lepton 无损压缩原理及性能分析