-
Notifications
You must be signed in to change notification settings - Fork 1
/
CreatWordListDB.h
43 lines (34 loc) · 1.1 KB
/
CreatWordListDB.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CREATWORDLISTDB_H
#define CREATWORDLISTDB_H
#include "MySQLite.h"
#include <QSqlTableModel>
#include <QWidget>
class CreatWordListDB : public MySQLite
{
public:
CreatWordListDB(const QString &dbpath,
const QString &connName);
~CreatWordListDB();
public:
bool addNewRecord(const QString &word,
const QString &mean,
const QString &connection,
const int &lektion);
bool removeRecord(const int &rowNum);
QStringList getRecord(const int &wid);
bool isExist(const QString &word);
bool updataWord(const QString &word, const int &wid);
bool updataMean(const QString &mean, const int &wid);
bool updataConnection(const QString &connection, const int &wid);
QSqlDatabase *getdb();
int getRowCount();
QSqlTableModel *wordListDBModel(QWidget *parent,
const QString &tableName);
QString getWordListName();
protected:
bool createTable(); // ´´½¨±í
private:
QString wordListName;
QSqlTableModel *DBModel;
};
#endif // CREATWORDLISTDB_H