当前位置:网站首页>QT thread and interface
QT thread and interface
2022-06-11 00:49:00 【Yutian Dudu】
Read an open source library Stacer, It's used inside QConcrrent, This is very convenient to use , Here is a brief record and summary Qt Thread creation method .
Qt Thread creation method
- QThread Inherit
- QObject moveToThread
- QConcurrent::run
Qt If threads are mentioned in, we have to talk about the relationship between threads and interface components .
Threads and interface components
- stay QT in , All interface component related operations must be in the main thread ( That is to say GUI thread), stay Qt Cannot create directly in the program thread QWidget Interface components like that , Nor can you directly operate interface components .
QThread How do threads operate interface components
Method 1
Bind the signal and... Of the thread object UI The slot of the object , Send in thread emit The signal .
Method 2
Inherit QEvent class , Use QApplication::postEvent() To send events to the interface
Method 3
Use it directly Invokes() Function to call the signal slot of the interface component object ,( Can be used to call UI Private signal or slot of the object ):
边栏推荐
- 启牛商学院中信建投账户怎么样?安全吗
- A simple understanding of B tree
- [network planning] 2.2.3 user server interaction: cookies
- How about the CSC account of qiniu business school? Is it safe?
- 海贼oj#146.字符串
- Idea setting background picture (simple)
- Using solrj to add, delete, modify, and query Solr is too simple
- RPC details
- Yum source update
- Multipass中文文档-使用指引(目录页)
猜你喜欢

非重叠矩形中的随机点

How to ensure the sequence of messages, that messages are not lost or consumed repeatedly

项目连接不到远程虚拟机The driver has not received any packets from the server.

How to guarantee the quality of real-time data, the cornerstone of the 100 million level search system (Youku Video Search)? v2020

With a market value of 21.5 billion yuan, will the post-80s generation in Sichuan make TV history?

Using solrj to add, delete, modify, and query Solr is too simple
![[network planning] 1.3 packet switching and circuit switching in the network core](/img/a8/74a1b44ce4d8b0b1a85043a091a91d.jpg)
[network planning] 1.3 packet switching and circuit switching in the network core
![[network planning] 2.2.4 Web cache / proxy server](/img/a8/74a1b44ce4d8b0b1a85043a091a91d.jpg)
[network planning] 2.2.4 Web cache / proxy server

MESI cache consistency protocol for concurrent programming

大厂是面对深度分页问题是如何解决的(通俗易懂)
随机推荐
阻塞隊列 — DelayedWorkQueue源碼分析
compiler explorer
Ts+fetch to upload selected files
Mysql database table backup
[untitled] test
Brief introduction to MySQL lock and transaction isolation level
【无标题】
On the quality assurance system of youzan search V2021
哈工大软件构造复习——LSP原则,协变和逆变
Multipass Chinese document - instructions for use (contents page)
【无标题】4555
BGP basic concept and iBGP basic configuration
teterttet
Unity custom folder icon color personalized unity compiler
f‘s‘f‘s‘f‘s‘d
负载均衡策略图文详解
Dictionary sort of array
[network planning] 2.5 brief introduction to P2P architecture
如何在office2016(word2016)中安装mathtype6.9及相关问题解决方案
Yii2 activerecord uses the ID associated with the table to automatically remove duplicates