- qtgui
- qtdbus
- qtwidgets
- qtcore
- dtkcore
- qsettingbackend_zh
- dobject_zh
- abstractappender_zh
- abstractstringappender_zh
- dfilewatcher_zh
- outputdebugappender_zh
- dsettingsbackend_zh
- drecentmanager_zh
- ddesktopentry_zh
- consoleappender_zh
- gsettingsbackend_zh
- dsettingsgroup_zh
- dlogmanager_zh
- fileappender_zh
- dsettings_zh
- dfilesystemwatcher_zh
- dfilewatchermanager_zh
- dbasefilewatcher_zh
- dtkgui
- dtkwidget
- dviewitemaction_zh
- dstandarditem_zh
- dfiledialog_zh
- dclipeffectwidget_zh
- danchors_zh
- dgraphicsclipeffect_zh
- dstyle_zh
- dcoloredprogressbar_zh
- dbuttonboxbutton_zh
- dlabel_zh
- dtiplabel_zh
- darrowlinedrawer_zh
- daboutdialog_zh
- dsettingswidgetfactory_zh
- dsearchcombobox_zh
- dcrumbedit_zh
- dcommandlinkbutton_zh
- dsettingsdialog_zh
- dwindowoptionbutton_zh
- dspinner_zh
- dsimplelistview_zh
- dwaterprogress_zh
- dmainwindow_zh
- dhidpihelper_zh
- dslider_zh
- dpasswordedit_zh
- danchorinfo_zh
- dmpriscontrol_zh
- darrowbutton_zh
- dbackgroundgroup_zh
- dcircleprogress_zh
- dwarningbutton_zh
- dwindowclosebutton_zh
- dvideowidget_zh
- dfilechooseredit_zh
- dblureffectwidget_zh
- darrowrectangle_zh
- dsearchedit_zh
- dfloatingmessage_zh
- dswitchlineexpand_zh
- dtabbar_zh
- dlineedit_zh
- danchorsbase_zh
- dstylediconengine_zh
- dwindowmaxbutton_zh
- dpageindicator_zh
- dsuggestbutton_zh
- dapplicationsettings_zh
- dtooltip_zh
- dwindowminbutton_zh
- ddrawer_zh
- dtitlebar_zh
- dsimplelistitem_zh
- dpicturesequenceview_zh
dobject_zh
Class::DObject
暂无该属性
Detailed Description
~chinese ~chinese
deepin-tool-kit 中所有公开类的祖先类。 ~chinese 通过和 UnknownCommand D_DECLARE_PRIVATE 、UnknownCommand D_DECLARE_PUBLIC ~chinese 等宏的配合方便派生类中实现 D-Point 结构。虽然 QObject 中已经有了这样的实现结构,但是没有 ~chinese 办法在不使用 Qt 私有模块的情况下,在 DTK 库中达到同样的目的。D-Point 结构由“公共接口类” ~chinese 和“私有数据类”两部分组成,在 DTK 中,DObjectPrivate 是所有数据类的祖先类。在这种结构下, ~chinese 只有 DObject 这个基类中定了一个指向于私有数据类的对象指针,派生类中不会也不应该再定义任何 ~chinese 成员变量,派生类中需要添加数据成员时,可以继承 DObjectPrivate,将新的成员变量放到私有类中
~chinese 例子:
~chinese a.h
class APrivate;
class A : public DObject
{
D_DECLARE_PRIVATE(A)
public:
A();
int test() const;
protected:
A(APrivate &dd, DObject *parent = nullptr);
};
~chinese a.cpp
class APrivate : public DObjectPrivate
{
public:
APrivate(A *qq)
: DObjectPrivate(qq)
{
}
D_DECLARE_PUBLIC(A)
// 此处添加数据成员
int data;
};
A::A()
: DObject(*new APrivate(this))
{
}
int test() const
{
D_D(A);
return d->data;
}
A::A(APrivate &dd, DObject *parent)
: DObject(dd, parent)
{
}
一般来讲, DObject 只会用在 DTK 库中定义的类,对于使用 DTK 库的应用程序来说不用关心它的存在 ~chinese
See also href{https://wiki.qt.io/D-Pointer/zh,类的 D-Point 结构}
DObject::DObject
DObject(DObject *parent) ~chinese
只有在不需要数据成员的派生类中才会使用
DObject::DObject
DObject(DObjectPrivate &dd, DObject *parent) ~chinese
在派生类中比较常用的构造函数 ~chinese dd 私有类对象
DObject::~DObject
[protected destructor virtual]
~DObject()
DObject::DObject
DObject(const DObject &)
DObject::operator=
DObject & operator=(const DObject &)
DObject::d_func
DObjectPrivate * d_func()
DObject::d_func
const DObjectPrivate * d_func() const