摘要:
析构时候清除pointer template <typename T> struct QScopedPointerDeleter { static inline void cleanup(T *pointer) { // Enforce a complete type. // If you get a compile error here, read the secion on forw... 阅读全文
posted @ 2011-03-01 16:01
katago
阅读(1193)
评论(0)
推荐(0)
摘要:
[Qt] QScopedPointer介绍 QScopedPointer 就分配空间和释放空间而言,Qt的处理有点乏味,要不然是通过隐式共享的containers,要不然就是通过QObject的父子关系模式。但总有些时候我们需要在堆上分配一些空间,问题来了,我们该在哪里delete它,如何能够确保不产生内存泄露呢? QScopedPointer就为了解决这个问题而生的,哈哈 QScopedPoin... 阅读全文
posted @ 2011-03-01 15:20
katago
阅读(14577)
评论(0)
推荐(0)
摘要:
#ifndef SETTINGS_H #define SETTINGS_H #include <QString> #include <QVariant> class QSettings; class Settings { public: Settings(const QString & fileName); ~Settings(); void setValue ( const QString... 阅读全文
posted @ 2011-03-01 14:49
katago
阅读(3167)
评论(0)
推荐(0)

浙公网安备 33010602011771号