feat:新增应用场景分类,登陆页面,数据库增删改查接口
@ -0,0 +1,13 @@
|
||||
HEADERS += \
|
||||
$$PWD/mydatabase.h \
|
||||
$$PWD/userlogin.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/mydatabase.cpp \
|
||||
$$PWD/userlogin.cpp
|
||||
|
||||
RESOURCES += \
|
||||
$$PWD/res.qrc
|
||||
|
||||
FORMS += \
|
||||
$$PWD/userlogin.ui
|
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 8.1 KiB |
@ -0,0 +1,243 @@
|
||||
#include "mydatabase.h"
|
||||
#include <QCoreApplication>
|
||||
|
||||
MyDatabase::MyDatabase()
|
||||
{
|
||||
if (QSqlDatabase::contains("qt_sql_default_connection"))
|
||||
{
|
||||
database = QSqlDatabase::database("qt_sql_default_connection");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 建立和SQlite数据库的连接
|
||||
database = QSqlDatabase::addDatabase("QSQLITE");
|
||||
QString dbPath = QCoreApplication::applicationDirPath() + "//UserDataBase.db";
|
||||
// 设置数据库文件的名字
|
||||
database.setDatabaseName(dbPath);
|
||||
database.setUserName("root");
|
||||
database.setPassword("123456");
|
||||
}
|
||||
|
||||
openDb();
|
||||
if(!isTableExist("user"))
|
||||
{
|
||||
createTable();
|
||||
}
|
||||
|
||||
QList<userData> list;
|
||||
userData u1 = {"wanghaoyu1","123456","yingji"};
|
||||
userData u2 = {"wanghaoyu2","123456","ceshi"};
|
||||
userData u3 = {"wanghaoyu3","123456","haha"};
|
||||
list += {u1,u2,u3};
|
||||
|
||||
multipleInsertData(list);
|
||||
userData u4 = {"wanghaoyu4","123456","yingji1"};
|
||||
singleInsertData(u4);
|
||||
// deleteData("wanghaoyu4");
|
||||
// queryDataByUsername("wanghaoyu3");
|
||||
// updateDataByUsername("wanghaoyu3","234567","ceshi");
|
||||
}
|
||||
|
||||
bool MyDatabase::openDb()
|
||||
{
|
||||
if (!database.open())
|
||||
{
|
||||
qDebug() << "Error: Failed to connect database." << database.lastError();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "数据库打开成功." ;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MyDatabase::createTable()
|
||||
{
|
||||
// 用于执行sql语句的对象
|
||||
QSqlQuery sqlQuery;
|
||||
// 构建创建数据库的sql语句字符串
|
||||
QString createSql = QString("CREATE TABLE IF NOT EXISTS user (\
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,\
|
||||
username VARCHAR(50) UNIQUE NOT NULL,\
|
||||
password VARCHAR(50) NOT NULL,\
|
||||
scene VARCHAR(100) NOT NULL,\
|
||||
is_del INTEGER DEFAULT 0,\
|
||||
created_at TIMESTAMP DEFAULT (DATETIME('now', 'localtime')),\
|
||||
updated_at TIMESTAMP DEFAULT (DATETIME('now', 'localtime')))");
|
||||
sqlQuery.prepare(createSql);
|
||||
|
||||
// 创建触发器
|
||||
QString triggerSql = R"(
|
||||
CREATE TRIGGER IF NOT EXISTS update_user_updated_at
|
||||
AFTER UPDATE ON user
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE user SET updated_at = CURRENT_TIMESTAMP WHERE id = OLD.id;
|
||||
END;
|
||||
)";
|
||||
|
||||
// 执行sql语句
|
||||
if(!sqlQuery.exec())
|
||||
{
|
||||
qDebug() << "Error: Fail to create table. " << sqlQuery.lastError();
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Table created!";
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::isTableExist(const QString &tableName)
|
||||
{
|
||||
if(!database.isOpen())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return database.tables().contains(tableName);
|
||||
}
|
||||
|
||||
bool MyDatabase::singleInsertData(userData &singleData)
|
||||
{
|
||||
database.transaction();//开启事务
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("INSERT INTO user (username, password, scene) VALUES(?, ?, ?)");
|
||||
sqlQuery.addBindValue(singleData.username);
|
||||
sqlQuery.addBindValue(singleData.password);
|
||||
sqlQuery.addBindValue(singleData.scene);
|
||||
if(!sqlQuery.exec())
|
||||
{
|
||||
if(sqlQuery.lastError().text().contains("UNIQUE constraint failed"))
|
||||
{
|
||||
qDebug() << "用户名已存在:" << singleData.username;
|
||||
}
|
||||
qDebug() << "Error: Fail to insert data. " << sqlQuery.lastError();
|
||||
database.rollback();//回滚
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
database.commit();//提交
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::multipleInsertData(QList<userData> &multipleData)
|
||||
{
|
||||
database.transaction();//开启事务
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("INSERT INTO user (username, password, scene) VALUES(?, ?, ?)");
|
||||
|
||||
QVariantList usernameList,passwordList,sceneList;
|
||||
for(userData value : multipleData)
|
||||
{
|
||||
usernameList << value.username;
|
||||
passwordList << value.password;
|
||||
sceneList << value.scene;
|
||||
}
|
||||
|
||||
sqlQuery.addBindValue(usernameList);
|
||||
sqlQuery.addBindValue(passwordList);
|
||||
sqlQuery.addBindValue(sceneList);
|
||||
|
||||
if(!sqlQuery.execBatch())
|
||||
{
|
||||
qDebug() << "Error: Fail to insert data. " << sqlQuery.lastError();
|
||||
database.rollback();//回滚
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
database.commit();//提交
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::deleteData(const QString &username)
|
||||
{
|
||||
database.transaction();
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("UPDATE user SET is_del=?,updated_at=(DATETIME('now', 'localtime')) WHERE username=?");
|
||||
sqlQuery.addBindValue(1);
|
||||
sqlQuery.addBindValue(username);
|
||||
if(!sqlQuery.exec())
|
||||
{
|
||||
qDebug() << "Error: Fail to delete data. "<< sqlQuery.lastError();
|
||||
database.rollback();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "delete data success!";
|
||||
database.commit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::updateDataByUsername(const QString &username, const QString &password, const QString &scene)
|
||||
{
|
||||
if(!queryDataByUsername(username))//根据用户名没有查询到数据-不进行更新操作
|
||||
{
|
||||
return false;
|
||||
}
|
||||
database.transaction();
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("UPDATE user SET password=? ,scene=?,updated_at=(DATETIME('now', 'localtime')) WHERE username=?");
|
||||
sqlQuery.addBindValue(password);
|
||||
sqlQuery.addBindValue(scene);
|
||||
sqlQuery.addBindValue(username);
|
||||
if(!sqlQuery.exec())
|
||||
{
|
||||
qDebug() << "Error: Fail to update data. "<< sqlQuery.lastError();
|
||||
database.rollback();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "update data success!";
|
||||
database.commit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::queryDataByUsername(const QString &username)
|
||||
{
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("SELECT * FROM user WHERE is_del = 0 AND username=?");
|
||||
sqlQuery.addBindValue(username);
|
||||
if(!sqlQuery.exec())
|
||||
{
|
||||
qDebug() << "Error: Fail to query table. " << sqlQuery.lastError();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "query data success!";
|
||||
if(!sqlQuery.next())
|
||||
{
|
||||
qDebug() << "No data found!";//没找到数据
|
||||
return false;
|
||||
}
|
||||
|
||||
sqlQuery.previous();
|
||||
|
||||
while(sqlQuery.next())
|
||||
{
|
||||
int id = sqlQuery.value("id").toInt();
|
||||
_queryUserData.username = sqlQuery.value("username").toString();
|
||||
_queryUserData.password = sqlQuery.value("password").toString();
|
||||
_queryUserData.scene = sqlQuery.value("scene").toString();
|
||||
|
||||
qDebug()<<QString("id:%1 username:%2 password:%3 scene:%4")
|
||||
.arg(id).arg(_queryUserData.username).arg(_queryUserData.password).arg(_queryUserData.scene);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
userData MyDatabase::getQueryUserData()
|
||||
{
|
||||
return _queryUserData;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
#ifndef MYDATABASE_H
|
||||
#define MYDATABASE_H
|
||||
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
#include <QDebug>
|
||||
#include <QList>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
QString username;
|
||||
QString password;
|
||||
QString scene;
|
||||
}userData;
|
||||
|
||||
class MyDatabase
|
||||
{
|
||||
public:
|
||||
MyDatabase();
|
||||
|
||||
// 打开数据库
|
||||
bool openDb();
|
||||
|
||||
// 创建数据表
|
||||
void createTable();
|
||||
|
||||
// 判断数据表是否存在
|
||||
bool isTableExist(const QString& tableName);
|
||||
|
||||
// 插入数据
|
||||
bool singleInsertData(userData &singleData); // 插入单条数据
|
||||
bool multipleInsertData(QList<userData> &multipleData); // 插入多条数据
|
||||
|
||||
//删除数据
|
||||
bool deleteData(const QString &username);
|
||||
|
||||
//修改数据-密码 场景
|
||||
bool updateDataByUsername(const QString &username, const QString &password, const QString &scene);
|
||||
|
||||
//查询数据
|
||||
bool queryDataByUsername(const QString &username);
|
||||
|
||||
//获取查询到的数据
|
||||
userData getQueryUserData();
|
||||
private:
|
||||
QSqlDatabase database;// 用于建立和数据库的连接
|
||||
userData _queryUserData;
|
||||
};
|
||||
|
||||
#endif // MYDATABASE_H
|
@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>img/eyesOpen.png</file>
|
||||
<file>img/eyesOpen1.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,230 @@
|
||||
#include "userlogin.h"
|
||||
#include "ui_userlogin.h"
|
||||
#include <QMessageBox>
|
||||
#include <QRegularExpressionValidator>
|
||||
#include <QLabel>
|
||||
|
||||
UserLogin::UserLogin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::UserLogin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initLineEdit();
|
||||
initControls();
|
||||
}
|
||||
|
||||
UserLogin::~UserLogin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void UserLogin::initLineEdit()
|
||||
{
|
||||
// 定义正则表达式:允许大写字母、小写字母、数字和特殊符号
|
||||
QRegularExpression regExp("[A-Za-z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+");
|
||||
|
||||
// 创建验证器
|
||||
QRegularExpressionValidator *validator = new QRegularExpressionValidator(regExp, this);
|
||||
|
||||
// 设置验证器
|
||||
ui->userlineEdit->setValidator(validator);
|
||||
ui->passwordlineEdit->setValidator(validator);
|
||||
}
|
||||
|
||||
void UserLogin::initControls()
|
||||
{
|
||||
QPixmap pixmap(":/res/SDFP3.png");
|
||||
ui->loginlabel->setPixmap(pixmap);
|
||||
ui->loginlabel->setScaledContents(true);
|
||||
|
||||
ui->widget_2->setStyleSheet("background-color: #1E1E1D;"
|
||||
"border-top-left-radius: 20px; "
|
||||
"border-top-right-radius: 20px;");
|
||||
|
||||
ui->widget_3->setObjectName("widget_3"); // 给 widget_3 设置对象名称
|
||||
ui->widget_3->setStyleSheet("QWidget#widget_3 {"
|
||||
"background-color: #363636;"
|
||||
"border-bottom-left-radius: 20px; "
|
||||
"border-bottom-right-radius: 20px;"
|
||||
"}");
|
||||
|
||||
ui->userlineEdit->setStyleSheet("border-radius: 5px;");
|
||||
ui->passwordlineEdit->setStyleSheet("border-radius: 5px;");
|
||||
ui->loginButton->setStyleSheet("QPushButton{"
|
||||
"font-family: STHupo;"
|
||||
"border-radius: 15px;"
|
||||
"color: white;"
|
||||
"font-weight: bold;"
|
||||
"border: none;"
|
||||
"background-color: #5289C1;"
|
||||
"font-size: 20px;"
|
||||
"}"
|
||||
// 设置按钮悬停时的样式
|
||||
"QPushButton:hover {"
|
||||
"background-color: #4078A9;" // 悬停时的背景颜色
|
||||
"}"
|
||||
// 设置按钮按下或选中时的渐变背景
|
||||
"QPushButton::pressed, QPushButton::checked {"
|
||||
"color: #FFFFFF;" // 字体颜色为白色
|
||||
"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, "
|
||||
"stop:0 #273c75, stop:1 #487eb0);" // 渐变背景
|
||||
"}");
|
||||
|
||||
ui->exitButton->setStyleSheet("QPushButton{"
|
||||
"font-family: STHupo;"
|
||||
"border-radius: 15px;"
|
||||
"color: white;"
|
||||
"font-weight: bold;"
|
||||
"border: none;"
|
||||
"background-color: #A52A2A;"
|
||||
"font-size: 20px;"
|
||||
"}"
|
||||
// 设置按钮悬停时的样式
|
||||
"QPushButton:hover {"
|
||||
"background-color: #8B1C1C;" // 悬停时的背景颜色
|
||||
"}"
|
||||
// 设置按钮按下或选中时的渐变背景
|
||||
"QPushButton::pressed, QPushButton::checked {"
|
||||
"color: #FFFFFF;" // 字体颜色为白色
|
||||
"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, "
|
||||
"stop:0 #5C1919, stop:1 #9E2A2A);" // 渐变背景
|
||||
"}");
|
||||
|
||||
|
||||
_passwordCheckBox = new QCheckBox(ui->passwordlineEdit);
|
||||
//设置样式表(图片为眼睛样式)
|
||||
_passwordCheckBox->setStyleSheet("QCheckBox::indicator {"
|
||||
"width: 20px;"
|
||||
"height: 20px;"
|
||||
"image: url(:/res/eyec1.png);" // 未选中时的图片
|
||||
"}"
|
||||
"QCheckBox::indicator:checked {"
|
||||
"image: url(:/res/eye3.png);" // 选中时的图片
|
||||
"}");
|
||||
|
||||
|
||||
ui->label->setStyleSheet("QLabel {"
|
||||
"font-family: 'STHupo';" // 使用艺术字体
|
||||
"font-size: 40px;" // 设置字体大小
|
||||
"font-weight: bold;" // 设置加粗
|
||||
"color: #5289C1;" // 设置字体颜色
|
||||
"text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);" // 添加阴影效果
|
||||
"}");
|
||||
ui->label->setAlignment(Qt::AlignCenter);
|
||||
|
||||
ui->pushButton->setStyleSheet("QPushButton {"
|
||||
"border: none;" // 没有边框
|
||||
"color: white;" // 默认字体颜色为白色
|
||||
"font-size: 18px;" // 字体大小为 20
|
||||
"font-weight: bold;"
|
||||
"background-color: transparent;" // 背景透明
|
||||
"font-family: 'STHeiti';"
|
||||
"}"
|
||||
|
||||
// 设置按钮悬停时的样式
|
||||
"QPushButton:hover {"
|
||||
"color: #5289C1;" // 悬停时字体颜色变为橙色
|
||||
"}"
|
||||
|
||||
// 设置按钮按下时的字体颜色
|
||||
"QPushButton:pressed {"
|
||||
"color: #4A7DB0;" // 按下时字体颜色变为绿色
|
||||
"}"
|
||||
|
||||
// 设置按钮选中时的样式
|
||||
"QPushButton:checked {"
|
||||
"color: #5289C1;" // 选中时字体颜色变为绿色
|
||||
"}");
|
||||
|
||||
connect(_passwordCheckBox,&QCheckBox::checkStateChanged,this,[this](int state){
|
||||
if(state == Qt::Checked)
|
||||
{
|
||||
ui->passwordlineEdit->setEchoMode(QLineEdit::Normal);
|
||||
}
|
||||
else if(state == Qt::Unchecked)
|
||||
{
|
||||
ui->passwordlineEdit->setEchoMode(QLineEdit::Password);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool UserLogin::checkEditFormat(const QString &edit, const QString &origins)
|
||||
{
|
||||
if(edit.isEmpty())
|
||||
{
|
||||
QMessageBox::information(NULL, "提示", "输入"+origins+"不能为空!");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 定义正则表达式:至少 8 个字符,且只能是大写字母、小写字母、数字和特殊符号
|
||||
QRegularExpression regExp("[A-Za-z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]{6,}");
|
||||
|
||||
// 检查输入内容
|
||||
if (!regExp.match(edit).hasMatch())
|
||||
{
|
||||
QMessageBox::information(NULL, "提示", origins +"至少输入 6 个字符,且只能包含大写字母、小写字母、数字和特殊符号!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UserLogin::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
_passwordCheckBox->setGeometry(ui->passwordlineEdit->width()-30,(ui->passwordlineEdit->height()/2)-10,20,20);
|
||||
}
|
||||
|
||||
void UserLogin::on_loginButton_clicked()
|
||||
{
|
||||
if(!checkEditFormat(ui->userlineEdit->text(),"用户名"))
|
||||
return;
|
||||
if(!checkEditFormat(ui->passwordlineEdit->text(),"密码"))
|
||||
return;
|
||||
|
||||
//查询到数据
|
||||
if(dataBase.queryDataByUsername(ui->userlineEdit->text()))
|
||||
{
|
||||
_queryUserData = dataBase.getQueryUserData();
|
||||
if(_queryUserData.password == ui->passwordlineEdit->text())//密码匹配
|
||||
{
|
||||
//判断场景
|
||||
if(_queryUserData.scene == "yingji")
|
||||
{
|
||||
emit sendSenceData(use_sence::Emergency);
|
||||
QMessageBox::information(NULL, "提示", "进入应急场景!");
|
||||
}
|
||||
else if(_queryUserData.scene == "ceshi")
|
||||
{
|
||||
emit sendSenceData(use_sence::Sea_Rescue);
|
||||
QMessageBox::information(NULL, "提示", "进入测试场景!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(NULL, "提示", "密码输入错误!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//用户名不存在
|
||||
QMessageBox::information(NULL, "提示", "用户名不存在!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_pushButton_clicked()
|
||||
{
|
||||
emit loginDlgClick(click_type::HomePageClick);
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_exitButton_clicked()
|
||||
{
|
||||
emit loginDlgClick(click_type::ExitLogin);
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
#ifndef USERLOGIN_H
|
||||
#define USERLOGIN_H
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QWidget>
|
||||
#include "mydatabase.h"
|
||||
|
||||
namespace Ui {
|
||||
class UserLogin;
|
||||
}
|
||||
|
||||
class UserLogin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UserLogin(QWidget *parent = nullptr);
|
||||
~UserLogin();
|
||||
|
||||
enum use_sence : unsigned char
|
||||
{
|
||||
Emergency = 1, //应急 1
|
||||
Sea_Rescue, //海上救捞 2
|
||||
};
|
||||
|
||||
enum click_type : unsigned char
|
||||
{
|
||||
HomePageClick = 0, //主页点击
|
||||
ExitLogin, //退出登录
|
||||
};
|
||||
|
||||
private slots:
|
||||
void on_loginButton_clicked();
|
||||
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_exitButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::UserLogin *ui;
|
||||
MyDatabase dataBase;
|
||||
void initLineEdit();
|
||||
void initControls();
|
||||
bool checkEditFormat(const QString &edit, const QString &origins);
|
||||
userData _queryUserData;
|
||||
QCheckBox *_passwordCheckBox;
|
||||
signals:
|
||||
void sendSenceData(use_sence sence);
|
||||
void loginDlgClick(int clickType);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
};
|
||||
|
||||
#endif // USERLOGIN_H
|
@ -0,0 +1,573 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UserLogin</class>
|
||||
<widget class="QWidget" name="UserLogin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1288</width>
|
||||
<height>826</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>主页</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>130</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="widget_l" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>220</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="loginlabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>39</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LayoutDirection::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>HTFP-PayLoad</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignHCenter|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="userlineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>用户名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="passwordlineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>39</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::EchoMode::Password</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>密码</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="loginButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>登录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="exitButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>退出登录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 8.1 KiB |