完成1.更新数据库2.获取导航栏
This commit is contained in:
49
OfficeAssistant_msvc/sqlitehelper.h
Normal file
49
OfficeAssistant_msvc/sqlitehelper.h
Normal file
@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QtSql/QSqlError>
|
||||
#include <QtSql/QSqlQuery>
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
#include <QDate>
|
||||
#include <QtNetwork/QtNetwork>
|
||||
|
||||
#include "buttonstruct.h"
|
||||
typedef struct {
|
||||
int id;
|
||||
int sort;
|
||||
QString app_id;
|
||||
bool locked;
|
||||
QString type;
|
||||
QString category_id;
|
||||
QString logo;
|
||||
QString name;
|
||||
QString orig_name;
|
||||
QString version;
|
||||
QString dev;
|
||||
time_t create_time;
|
||||
time_t use_time;
|
||||
QString op;
|
||||
QString func;
|
||||
QString path;
|
||||
QString url;
|
||||
}Record;
|
||||
|
||||
class SQLiteHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SQLiteHelper(QObject *parent = nullptr);
|
||||
bool update_software();
|
||||
bool get_software(QList<ButtonStruct>* buttons);
|
||||
bool update_others();
|
||||
~SQLiteHelper();
|
||||
|
||||
private:
|
||||
QNetworkReply* reply;
|
||||
QEventLoop eventLoop;
|
||||
bool downloadSuccess;
|
||||
|
||||
QSqlDatabase db;
|
||||
void cancelDownload();
|
||||
};
|
Reference in New Issue
Block a user