This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/template/singleton.h
2021-05-20 18:27:45 +08:00

29 lines
394 B
C++

#ifndef SINGLETON_H
#define SINGLETON_H
#include <QDebug>
class Singleton
{
private:
static Singleton *local_instance;
Singleton()
{
qDebug() << "constructor";
}
~Singleton()
{
qDebug() << "destructor";
}
public:
static Singleton *getInstance()
{
static Singleton locla_s;
return &locla_s;
}
};
#endif // SINGLETON_H