单例的实现方法:
class Helper : public QObject
{
private:
explicit Helper(QObject *parent = 0);
static Helper *_instance;
public:
static Helper *getInstance()
{
static QMutex mutex;
if (!_instance)
{
QMutexLocker locker(&mutex);
if (!_instance)
{
_instance = new Helper;
}
}
return _instance;
}
void process(void);
};class Helper : public QObject