76 lines
2.1 KiB
C++
76 lines
2.1 KiB
C++
#include <QWidget>
|
|
#include <qlayout.h>
|
|
#include <qtablewidget.h>
|
|
#include <appConfig/sqlManager/sqlManager.h>
|
|
#include <qlabel.h>
|
|
#include <qstackedwidget.h>
|
|
#include <appConfig.h>
|
|
#include <uiModule/components/fancyButton.h>
|
|
|
|
class sqliteReader : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
sqliteReader();
|
|
~sqliteReader();
|
|
QVBoxLayout* layout1;
|
|
QTableWidget* tableWidget;
|
|
sqlManager* _sqlManager;
|
|
std::unordered_map<QString, QString>avoidMap;//不显示该数据
|
|
std::unordered_map<QString, QString>cuttomName;//自定义列名
|
|
void widgetInit(std::vector<std::string>tables);
|
|
void switchWidget(std::string tableNam);
|
|
void searchSN(std::string tableNam, std::string SN);
|
|
bool readIniFile(const QString& filePath);
|
|
};
|
|
class sqlControlWidget :public QWidget
|
|
{
|
|
public:
|
|
QVBoxLayout* Layout = new QVBoxLayout(this);
|
|
QHBoxLayout* btnLayout = new QHBoxLayout(this);
|
|
std::vector<gradientButton*>btns;
|
|
QLabel* icon, * Title;
|
|
QStackedWidget* widgets = new QStackedWidget();
|
|
sqliteReader _sqliteReader;
|
|
QTableWidget* sqlWidget = new QTableWidget();
|
|
QLabel* disconnnectedLabel = new QLabel("服务已离线");
|
|
sqlControlWidget()
|
|
{
|
|
QPalette palette;
|
|
palette.setColor(QPalette::WindowText, Qt::white);
|
|
QFont font("微软雅黑", 24, QFont::Bold);
|
|
QFont font2("微软雅黑", 108, QFont::Bold);
|
|
|
|
widgets->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
widgets->setMaximumSize(9999, 9999);
|
|
|
|
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
this->setMaximumSize(9999, 9999);
|
|
this->setObjectName("sqlControlWidget");
|
|
|
|
Layout->setContentsMargins(0, 0, 0, 0);
|
|
Layout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
|
|
|
Title = new QLabel(u8"SQL操作界面");
|
|
Title->setFont(font);
|
|
Title->setPalette(palette);
|
|
Title->setAlignment(Qt::AlignLeft);
|
|
|
|
/*sqlWidget->setFont(font2);
|
|
sqlWidget->setPalette(palette);*/
|
|
//sqlWidget->setAlignment(Qt::AlignCenter);
|
|
|
|
Layout->addWidget(Title);
|
|
|
|
btnLayout->setContentsMargins(0, 0, 0, 0);
|
|
btnLayout->setAlignment(Qt::AlignLeft);
|
|
|
|
//btnLayout->addWidget(sqlWidget);
|
|
|
|
Layout->addLayout(btnLayout);
|
|
|
|
Layout->addWidget(&_sqliteReader);
|
|
}
|
|
};
|
|
#pragma once |