sqlitedao.h 508 B

123456789101112131415161718192021222324
  1. #ifndef SQLITEDAO_H
  2. #define SQLITEDAO_H
  3. #include "sqlitewrapper.h"
  4. #include <QApplication>
  5. #include <QObject>
  6. class SqliteDao : public QObject {
  7. Q_OBJECT
  8. public:
  9. static SqliteDao* instance();
  10. static void freeInstance();
  11. SqliteWrapper* sqliteWrapper() const;
  12. bool transaction();
  13. void commit();
  14. signals:
  15. private:
  16. explicit SqliteDao(QObject* parent = nullptr);
  17. static SqliteDao* m_instance;
  18. SqliteWrapper* m_sqliteWrapper;
  19. };
  20. SqliteDao* sqliteDao();
  21. #endif // SQLITEDAO_H