关于QT的一个小问题
.cpp文件中
//QScopedPointer<UIMainControlPrivate> d_ptr; .h文件中
d_ptr.reset(new UIMainControlPrivate(GetUIONSList(),
GetPopupList()));
Singleton<UIKeyTranslator>::create();
UIKeyTranslatorInst.onInitialize();
UIKeyManagerInst.setTranslator(&UIKeyTranslatorInst);
Q_D(UIMainControl);
d->m_controllersManager.onInitialize();//这里的d其实就是d_ptr,这个我不怎么明白
#define Q_D(Class) Class##Private * const d = d_func()
#define Q_DECLARE_PRIVATE(Class) \
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
friend class Class##Private;