当前位置:网站首页>QT notes - Q_ Q and Q_ D learning
QT notes - Q_ Q and Q_ D learning
2022-07-26 03:14:00 【Cool breeze in the old street °】
In the source code , We will often see Q_Q and Q_D These two things , I'm curious , I went online to search for some and Checked some source code part
Q_D Related macro
#define Q_D(Class) Class##Private * const d = d_func()
Q_D(Test)
// After deployment It's a Pointer constants of private classes
TestPrivate * const d = d_func();
d_func()
QScopedPointer<QPainterPathPrivate, QPainterPathPrivateDeleter> d_ptr;
QPainterPathData *d_func() const {
return reinterpret_cast<QPainterPathData *>(d_ptr.data()); }
Q_DECLARE_PRIVATE(Class)
#define Q_DECLARE_PRIVATE(Class) \ inline Class##Private* d_func() \ {
Q_CAST_IGNORE_ALIGN(return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr));) } \ inline const Class##Private* d_func() const \ {
Q_CAST_IGNORE_ALIGN(return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr));) } \ friend class Class##Private;
Q_DECLARE_PRIVATE(Test)
// After deployment
inline TestPrivate* d_func() {
return reinterpret_cast<TestPrivate *>(qGetPtrHelper(d_ptr));}
inline const TestPrivate* d_func() const{
return reinterpret_cast<const TestPrivate *>(qGetPtrHelper(d_ptr));}
friend class TestPrivate;
Q_Q Related macro
#define Q_Q(Class) Class * const q = q_func()
**Q_DECLARE_PUBLIC(Class) **
#define Q_DECLARE_PUBLIC(Class) \ inline Class* q_func() {
return static_cast<Class *>(q_ptr); } \ inline const Class* q_func() const {
return static_cast<const Class *>(q_ptr); } \ friend class Class;
Q_DECLARE_PUBLIC(Test)
inline Test* q_func() {
return static_cast<Test*>(q_ptr); }
inline const Test* q_func() const {
return static_cast<const Test*>(q_ptr); }
friend class Test;
边栏推荐
- STM——EXTI外部中断学习笔记
- Win11 method of changing disk drive letter
- STM - exti external interrupt learning notes
- [SQL] CASE表达式
- Installation and operation of orb-slam2 under ROS
- Pit trodden when copying list: shallow copy and deep copy
- Standardize your own debug process
- JSD-2204-酷鲨商城(管理商品模块)-Day02
- Istio三之VirtualService、Gateway、DestinationRule配置使用
- Programming example of STM32 state machine -- fully automatic washing machine (Part 1)
猜你喜欢

如何用U盘进行装机?

Hcip day 8 notes sorting (OSPF routing control, Appendix E, anti ring, shortest path calculation, republication))

js中数组排序的方法有哪些

中国信通院陈屹力:降本增效是企业云原生应用的最大价值

Summary of Huawei virtualization fusioncompute knowledge points

在混合云中管理数据库:八个关键注意事项

Managing databases in a hybrid cloud: eight key considerations

Swin Transformer【Backbone】

Win11隐藏输入法状态栏方法
![[Yuri crack man] brings you easy understanding - deep copy and shallow copy](/img/26/b7330c7f5fdac55c8f5e9fa24658ee.png)
[Yuri crack man] brings you easy understanding - deep copy and shallow copy
随机推荐
GoLang日志编程系统
STM32——DMA笔记
Istio三之VirtualService、Gateway、DestinationRule配置使用
Safety margin of mass consumption
[noip2001 popularization group] the problem of maximum common divisor and minimum common multiple
堆内存与栈内存的区别?
Docker installs redis!!! (including detailed illustration of each step) actual combat
[Yuri crack man] brings you easy understanding - deep copy and shallow copy
2022-07-21 第四小组 多态
中国信通院陈屹力:降本增效是企业云原生应用的最大价值
ue4如何进行静态渲染?5个步骤生成静态渲染
NFT因无意义而美丽
实现一个方法,找出数组中的第k大和第m大的数字相加之和
els 消息循环
STM - exti external interrupt learning notes
2022-07-21 第四小组 修身课 学习笔记(every day)
Hcip day 8 notes sorting (OSPF routing control, Appendix E, anti ring, shortest path calculation, republication))
Multithreaded programming
Type the URL to the web page display. What happened during this period?
STM32——串口学习笔记(一个字节、16位数据、字符串、数组)