-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdefs.h
More file actions
27 lines (20 loc) · 936 Bytes
/
defs.h
File metadata and controls
27 lines (20 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef DEFS_H
#define DEFS_H
#include <QObject>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileDevice>
#include <QIODevice>
#define DELETE_OBJ(o){if(o != Q_NULLPTR){delete o; o = Q_NULLPTR;}}
#define DELETE_OBJ_LATER(o){if(o != Q_NULLPTR){o->deleteLater();}}
#define DELETE_STR(s){if(s != Q_NULLPTR){delete [] s; s = Q_NULLPTR;}}
#define qDbg() qDebug() << "["<< (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) << __func__ << __LINE__ << "]: "
#define qDbgVar(v) qDbg() << #v << v;
#define qMd5(s) QCryptographicHash::hash(s.toLocal8Bit(), QCryptographicHash::Md5).toHex()
#include "cffutils.h"
/*
#define MEMWATCH(obj, objq) ExMemWatcher::getInstance()->addObject(reinterpret_cast<qlonglong>(obj), QStringLiteral(#objq)); \
connect(obj, &objq::destroyed, [o=obj](){ExMemWatcher::getInstance()->removeObject(reinterpret_cast<qlonglong>(o));})
*/
#endif // DEFS_H