当前位置:网站首页>QT tutorial: signal and slot mechanism
QT tutorial: signal and slot mechanism
2022-07-03 19:53:00 【Cheems_ Pak Choi】
One 、 Connection of signal and slot
1、QT5 Writing above version :
connect(xxx,&yyy,this,&zzz);
xxx: Sender of signal , This parameter is a pointer
&yyy: Signaler , An internal signal ( Format :& + The name of the signaler class + :: + Signal name ), To add an address symbol
this: The receiver of the signal , This parameter is also a pointer ( Is not necessarily this)
&zzz: Signal processing function , To add an address symbol , It belongs to this,
2、QT edition 5 The following is a way to write :
connect(xxx,SIGNAL(yyy()),this,SLOT(zzz()));
xxx: Sender of signal , This parameter is a pointer
yyy(): Signaler
this: The receiver of the signal , This parameter is also a pointer ( Is not necessarily this)
zzz(): Signal processing function , It belongs to this,
Two 、 Custom slot function
1、 Slot function in Qt5, It can be any class member function 、 Global function 、 Static functions 、lambda expression ( Implicit functions )
2、 The slot function needs to correspond to the signal ( Return value 、 Parameters )
for example :
void mysignal(int ,double,QString);// The signal
void myslot(int ,double,QString);// Slot function
3、 The signal has no return value , The return value of the slot function :void
4、 The parameters of the slot function are to receive the data transmitted by the signal
5、 The parameters of the slot function should not be greater than the number of parameters of the signal , The parameters of the slot function can be less than the number of parameters of the signal
6、 Slot functions can be overloaded
7、 stay “private slots:” Make a statement or “public slots:” Make a statement
3、 ... and 、 Custom signal
1、 Must be in “signals:” Make a statement
2、 There can be parameters
3、 Overloading can happen
4、 The return value is Void
5、 Sending signal :emit+ Signal name
Four 、hide() function
It means to hide the current window
5、 ... and 、static
Static value , for example static int i = 0; It means static Zheng Xingzhi i, It will not be rebuilt later i=0, Instead, keep the last value
边栏推荐
- Day10 -- forced login, token refresh and JWT disable
- Vscode reports an error according to the go plug-in go get connectex: a connection attempt failed because the connected party did not pro
- Network security Kali penetration learning how to get started with web penetration how to scan based on nmap
- Chapter 2: find the classical solution of the maximum Convention and the least common multiple of a and B, find the conventional solution of the maximum Convention and the least common multiple of a a
- 2022-07-02 advanced network engineering (XV) routing policy - route policy feature, policy based routing, MQC (modular QoS command line)
- QT -- qfileinfo file information reading
- 2022-06-30 網工進階(十四)路由策略-匹配工具【ACL、IP-Prefix List】、策略工具【Filter-Policy】
- 4. Data splitting of Flink real-time project
- Xctf attack and defense world crypto master advanced area olddriver
- IP address is such an important knowledge that it's useless to listen to a younger student?
猜你喜欢

第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算

Vscode reports an error according to the go plug-in go get connectex: a connection attempt failed because the connected party did not pro

MPLS configuration

kubernetes集群搭建efk日志收集平台

10 smart contract developer tools that miss and lose

第二十章:y= sin(x)/x,漫步坐标系计算,y= sin(x)/x 带廓幅图形,奥运五环,小球滚动与弹跳,流水显示,矩形优化裁剪,r个皇后全控nxn棋盘

Point cloud data denoising

NFT without IPFs and completely on the chain?

第一章:求奇因数代数和,求同吗小数和s(d, n),简化同码小数和s(d, n),拓广同码小数和s(d, n)

Promethus
随机推荐
Network security Kali penetration learning how to get started with web penetration how to scan based on nmap
第一章:求n的阶乘n!
第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
Chapter 1: extend the same code decimal sum s (D, n)
第二章:基于分解的求水仙花数,基于组合的求水仙花数, 兰德尔数,求[x,y]内的守形数,探求n位守形数,递推探索n位逐位整除数
Microsoft: the 12th generation core processor needs to be upgraded to win11 to give full play to its maximum performance
Professional interpretation | how to become an SQL developer
Promethus
第一章:递归求n的阶乘n!
Summary of learning materials and notes of Zhang Fei's actual combat electronics 1-31
Zhang Fei hardware 90 day learning notes - personal record on day 6. Please see my personal profile / homepage for the complete record
Basic command of IP address configuration ---ip V4
Chapter 1: find all factorial sums, Grand Prix site unified programming, three factorial sums, graphic point scanning, recursive factorial n of n!, Find the factorial n of n!, King Shehan miscalculate
第一章:三位阶乘和数,图形点扫描
Part 27 supplement (27) buttons of QML basic elements
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
How to improve data security by renting servers in Hong Kong
unittest框架基本使用
04 -- QT OpenGL two sets of shaders draw two triangles
Octopus online ecological chain tour Atocha protocol received near grant worth $50000