当前位置:网站首页>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
边栏推荐
- What about wechat mall? 5 tips to clear your mind
- Kotlin Compose 与原生 嵌套使用
- Evolution of Baidu intelligent applet patrol scheduling scheme
- Getting started with Apache dolphin scheduler (one article is enough)
- 一文读懂TDengine的窗口查询功能
- 22-07-04 Xi'an Shanghao housing project experience summary (01)
- Why don't you recommend using products like mongodb to replace time series databases?
- Develop and implement movie recommendation applet based on wechat cloud
- 观测云与 TDengine 达成深度合作,优化企业上云体验
- [object array A and object array B take out different elements of ID and assign them to the new array]
猜你喜欢
How to use sqlcipher tool to decrypt encrypted database under Windows system
百度智能小程序巡检调度方案演进之路
Community group buying has triggered heated discussion. How does this model work?
On July 2, I invite you to TD Hero online press conference
Common fault analysis and Countermeasures of using MySQL in go language
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
Analysis on the wallet system architecture of Baidu trading platform
使用el-upload封装得组件怎么清空已上传附件
Windows uses commands to run kotlin
Unity skframework framework (XXIII), minimap small map tool
随机推荐
About getfragmentmanager () and getchildfragmentmanager ()
观测云与 TDengine 达成深度合作,优化企业上云体验
Baidu app's continuous integration practice based on pipeline as code
Getting started with Apache dolphin scheduler (one article is enough)
SQL learning alter add new field
[object array A and object array B take out different elements of ID and assign them to the new array]
搞数据库是不是越老越吃香?
H.265编码原理入门
Android SQLite database encryption
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
Apache dolphin scheduler system architecture design
百度智能小程序巡檢調度方案演進之路
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
Wechat applet obtains household area information
Principle and performance analysis of lepton lossless compression
Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?
MySQL does not take effect in sorting string types
Node の MongoDB Driver
【饿了么动态表格】