opencv_mv/QMainPro/QMacVisual/QWorld/QWorld.h

96 lines
2.6 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include <QtWidgets/QWidget>
#include <sstream>
#include <QString>
#include <QDomDocument>
#include <QTextStream>
#include <QFile>
#include <QDir>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QMessageBox>
#include <vector>
using namespace std;
#pragma region SoftKey
class SoftKey
{
public:
//SoftKey
QString GetKey(QString key);
};
#pragma endregion
#pragma region FolderOperation
class FolderOperation
{
public:
//删除N天前的文件
bool FindFileForDelete(QString key, QString path, int day = -30);
//删除N天前的文件夹
bool FindFolderForDelete(QString key, QString path, int day = 30);
};
#pragma endregion
#pragma region SQLite
class SQLite
{
public:
//创建并连接SQLite数据库
//sql_name为数据库文件路径QDir::currentPath() + "/MyDataBase.db"
//database为数据库
bool CreateConnectDB(QString key, QString sql_name, QSqlDatabase &database);
//创建表格;
//table_name为数据库的表格名称LoginTable
bool CreateTable(QString key, QString table_name);
//插入数据;
//table_name为数据库的表格名称LoginTableuser_name为用户名password为密码
bool InsertData(QString key, QString table_name, QString user_name, QString password);
//修改数据(默认表格为LoginTable)
//user_name为用户名password为修改的密码
bool ModifyData(QString key, QString user_name, QString password);
//查询数据(默认表格为LoginTable)
//user_name为用户名password为查询的密码
bool QueryData(QString key, QString user_name, QString &password);
//删除数据(默认表格为LoginTable)
//user_name为用户名
bool DeleteData(QString key, QString user_name);
//删除表格;
//table_name为数据库的表格名称LoginTable
bool DeleteTable(QString key, QString table_name);
//关闭数据库;
//database为数据库
bool CloseDB(QString key, QSqlDatabase database);
};
#pragma endregion
#pragma region XML
class XML
{
public:
//创建5个参数的Xml文件
//file_name为XML文件路径QDir::currentPath() + "/Param.xml"
bool CreateXml5(QString key, QString file_name, QString value1, QString value2, QString value3, QString value4, QString value5);
//创建9个参数的Xml文件
//file_name为XML文件路径QDir::currentPath() + "/Param.xml"
bool CreateXml9(QString key, QString file_name, QString value1, QString value2, QString value3, QString value4, QString value5, QString value6, QString value7, QString value8, QString value9);
//修改Xml文件的参数
bool ModifyXml(QString key, QString file_name, vector<string> parameter, vector<string> value);
//读取Xml文件的参数
bool ReadXml(QString key, QString file_name, QString parameter, QString& value);
};
#pragma endregion