| 1 |
// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DOBJECT_H |
| 6 |
#define DOBJECT_H |
| 7 |
|
| 8 |
#include <QScopedPointer> |
| 9 |
|
| 10 |
#include "dtkcore_global.h" |
| 11 |
|
| 12 |
DCORE_BEGIN_NAMESPACE |
| 13 |
|
| 14 |
#define D_DECLARE_PRIVATE(Class) Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_d_ptr),Class) |
| 15 |
#define D_DECLARE_PUBLIC(Class) Q_DECLARE_PUBLIC(Class) |
| 16 |
#define D_D(Class) Q_D(Class) |
| 17 |
#define D_Q(Class) Q_Q(Class) |
| 18 |
#define D_DC(Class) Q_D(const Class) |
| 19 |
#define D_QC(Class) Q_Q(const Class) |
| 20 |
#define D_PRIVATE_SLOT(Func) Q_PRIVATE_SLOT(d_func(), Func) |
| 21 |
|
| 22 |
class DObjectPrivate; |
| 23 |
|
| 24 |
class LIBDTKCORESHARED_EXPORT DObject |
| 25 |
{ |
| 26 |
protected: |
| 27 |
DObject(DObject *parent = nullptr); |
| 28 |
|
| 29 |
DObject(DObjectPrivate &dd, DObject *parent = nullptr); |
| 30 |
|
| 31 |
virtual ~DObject(); |
| 32 |
|
| 33 |
QScopedPointer<DObjectPrivate> d_d_ptr; |
| 34 |
|
| 35 |
Q_DISABLE_COPY(DObject) |
| 36 |
D_DECLARE_PRIVATE(DObject) |
| 37 |
}; |
| 38 |
|
| 39 |
DCORE_END_NAMESPACE |
| 40 |
|
| 41 |
#endif // DOBJECT_H |