Add SQLHelper and CenterAlignSqlTableModel. The CenterAlignSqlTableModel only make the cell text align center.
This commit is contained in:
25
src/db/SQLHelper.h
Normal file
25
src/db/SQLHelper.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Krad on 2021/10/11.
|
||||
//
|
||||
|
||||
#ifndef GUI_SQLHELPER_H
|
||||
#define GUI_SQLHELPER_H
|
||||
|
||||
class QSqlDatabase;
|
||||
#include "CenterAlignSqlTableModel.h"
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
|
||||
class SQLHelper {
|
||||
public:
|
||||
static bool Open();
|
||||
static bool Open(QSqlDatabase* base);
|
||||
static void Close();
|
||||
static QSqlTableModel* getTable(const QString & tableName);
|
||||
private:
|
||||
static QSqlDatabase* defaultDatabase;
|
||||
static QHash<QString,CenterAlignSqlTableModel*>* cache;
|
||||
};
|
||||
|
||||
|
||||
#endif //GUI_SQLHELPER_H
|
||||
Reference in New Issue
Block a user