SingletonAwesome.h 635 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef SINGLETONAWESOME_H
  2. #define SINGLETONAWESOME_H
  3. #include "QtAwesome.h"
  4. #include <QApplication>
  5. class SingletonAwesome
  6. {
  7. public:
  8. static SingletonAwesome &instance()
  9. {
  10. static SingletonAwesome qinstance;
  11. return qinstance;
  12. }
  13. QtAwesome *awesome() const { return m_awesome; }
  14. private:
  15. SingletonAwesome()
  16. {
  17. m_awesome = new QtAwesome(qApp);
  18. m_awesome->initFontAwesome();
  19. }
  20. SingletonAwesome(const SingletonAwesome &) = delete;
  21. SingletonAwesome &operator=(const SingletonAwesome &) = delete;
  22. QtAwesome *m_awesome = nullptr;
  23. };
  24. #endif // SINGLETONAWESOME_H