当前位置:网站首页>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
边栏推荐
- Leetcode 1189. Maximum number of balloons (special character count)
- BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
- Difference between surface go1 and surface GO2 (non professional comparison)
- Bright purple crystal meso tetra (4-aminophenyl) porphyrin tapp/tapppt/tappco/tappcd/tappzn/tapppd/tappcu/tappni/tappfe/tappmn metal complex - supplied by Qiyue
- 2022-06-25 网工进阶(十一)IS-IS-三大表(邻居表、路由表、链路状态数据库表)、LSP、CSNP、PSNP、LSP的同步过程
- BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu
- BUUCTF
- FAQs for datawhale learning!
- 第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
- BOC protected tryptophan zinc porphyrin (Zn · TAPP Trp BOC) / copper porphyrin (Cu · TAPP Trp BOC) / cobalt porphyrin (cobalt · TAPP Trp BOC) / iron porphyrin (Fe · TAPP Trp BOC) / Qiyue supply
猜你喜欢

Xctf attack and defense world crypto master advanced area olddriver

05 -- QT OpenGL draw cube uniform

第一章:简化同码小数和s(d, n)

Typora charges, WTF? Still need support

Common text labels

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

PR FAQ: how to set PR vertical screen sequence?
![Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively](/img/c5/0081689817700770f6210d50ec4e1f.png)
Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively

FAQs for datawhale learning!

FPGA 学习笔记:Vivado 2019.1 工程创建
随机推荐
05 -- QT OpenGL draw cube uniform
Use of aggregate functions
Zhang Fei hardware 90 day learning notes - personal record on day 5. Please see my personal profile / homepage for the complete record
第二章:4位卡普雷卡数,搜索偶数位卡普雷卡数,搜索n位2段和平方数,m位不含0的巧妙平方数,指定数字组成没有重复数字的7位平方数,求指定区间内的勾股数组,求指定区间内的倒立勾股数组
[raid] [simple DP] mine excavation
Nacos usage of micro services
第一章:求同吗小数和s(d, n)
2022-07-02 网工进阶(十五)路由策略-Route-Policy特性、策略路由(Policy-Based Routing)、MQC(模块化QoS命令行)
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
6. Data agent object Defineproperty method
Chapter 1: simplify the same code decimal sum s (D, n)
第一章:简化同码小数和s(d, n)
第二章:求长方体数组,指定区间内的完全数,改进指定区间内的完全数
4. Data binding
BOC protected tryptophan porphyrin compound (TAPP Trp BOC) Pink Solid 162.8mg supply - Qiyue supply
第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
Utilisation de base du cadre unitest
Leetcode daily question solution: 540 A single element in an ordered array
MPLS configuration
CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析