当前位置:网站首页>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
边栏推荐
- .Net之延迟队列
- Officially launched! Tdengine plug-in enters the official website of grafana
- Project practice | excel export function
- E-commerce apps are becoming more and more popular. What are the advantages of being an app?
- 让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
- Lepton 无损压缩原理及性能分析
- How to use sqlcipher tool to decrypt encrypted database under Windows system
- About getfragmentmanager () and getchildfragmentmanager ()
- Apache dolphin scheduler system architecture design
- SMT32H7系列DMA和DMAMUX的一点理解
猜你喜欢
Solve the problem of no all pattern found during Navicat activation and registration
百度评论中台的设计与探索
移动端异构运算技术-GPU OpenCL编程(进阶篇)
Unity skframework framework (XXII), runtime console runtime debugging tool
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
Community group buying exploded overnight. How should this new model of e-commerce operate?
tongweb设置gzip
Why does everyone want to do e-commerce? How much do you know about the advantages of online shopping malls?
mysql80服务不启动
E-commerce apps are becoming more and more popular. What are the advantages of being an app?
随机推荐
Common fault analysis and Countermeasures of using MySQL in go language
H. 265 introduction to coding principles
Officially launched! Tdengine plug-in enters the official website of grafana
cent7安装Oracle数据库报错
一文读懂TDengine的窗口查询功能
Application of data modeling based on wide table
TDengine 连接器上线 Google Data Studio 应用商店
TDengine可通过数据同步工具 DataX读写
【对象数组a与对象数组b取出id不同元素赋值给新的数组】
[JS sort according to the attributes in the object array]
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
百度评论中台的设计与探索
How do enterprises choose the appropriate three-level distribution system?
Unity skframework framework (XXIII), minimap small map tool
LeetCode 503. Next bigger Element II
Kotlin Compose 与原生 嵌套使用
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
Unity SKFramework框架(二十二)、Runtime Console 运行时调试工具
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...