Compare commits
4 Commits
main
...
user_login
Author | SHA1 | Date |
---|---|---|
|
ef1b56d0db | 3 days ago |
|
2afb94baac | 4 days ago |
|
d45c44a9e7 | 2 weeks ago |
|
56ce2fe598 | 2 weeks ago |
@ -0,0 +1,87 @@
|
||||
#include "udppushdlg.h"
|
||||
#include "ui_udppushdlg.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionValidator>
|
||||
|
||||
udpPushDlg::udpPushDlg(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::udpPushDlg)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setFixedSize(400,300);
|
||||
initLineEdit();
|
||||
QString urlFile = QCoreApplication::applicationDirPath() + "/config.ini";
|
||||
_configIni = std::make_unique<QSettings>(urlFile, QSettings::IniFormat);
|
||||
showParam4Ini();
|
||||
}
|
||||
|
||||
udpPushDlg::~udpPushDlg()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void udpPushDlg::initLineEdit()
|
||||
{
|
||||
// 定义正则表达式:允许大写字母、小写字母、数字和特殊符号
|
||||
QRegularExpression regExp("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
|
||||
// 创建验证器
|
||||
QRegularExpressionValidator *validator = new QRegularExpressionValidator(regExp, this);
|
||||
|
||||
QRegularExpression rx("[0-9]+"); // 只允许数字
|
||||
QRegularExpressionValidator *validator1 = new QRegularExpressionValidator(rx, this);
|
||||
|
||||
// 设置验证器
|
||||
ui->lineEdit->setValidator(validator);
|
||||
ui->lineEdit_2->setValidator(validator1);
|
||||
}
|
||||
|
||||
void udpPushDlg::showParam4Ini()
|
||||
{
|
||||
QString udpPushIp = _configIni->value("UDPPushStream/IP").toString();
|
||||
int udpPushPort = _configIni->value("UDPPushStream/Port").toInt();
|
||||
ui->lineEdit->setText(udpPushIp);
|
||||
ui->lineEdit_2->setText(QString::number(udpPushPort));
|
||||
}
|
||||
|
||||
void udpPushDlg::setStateByPushOrPull(udpUrlType tpye)
|
||||
{
|
||||
m_state = tpye;
|
||||
}
|
||||
|
||||
//保存界面IP及端口号参数
|
||||
void udpPushDlg::saveParam2Ini()
|
||||
{
|
||||
_configIni->setValue("UDPPushStream/IP", ui->lineEdit->text());
|
||||
_configIni->setValue("UDPPushStream/Port", ui->lineEdit_2->text());
|
||||
}
|
||||
|
||||
//点击确定按钮
|
||||
void udpPushDlg::on_okPushBtn_clicked()
|
||||
{
|
||||
if(ui->lineEdit->text().isEmpty())
|
||||
{
|
||||
emit sendErrorMessageSignal("输入IP地址不能为空",3);
|
||||
return;
|
||||
}
|
||||
|
||||
if(ui->lineEdit_2->text().isEmpty())
|
||||
{
|
||||
emit sendErrorMessageSignal("输入端口号不能为空",3);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this->isVisible())
|
||||
this->hide();
|
||||
m_udpPushUrl = QString("udp://%1:%2").arg(ui->lineEdit->text()).arg(ui->lineEdit_2->text());
|
||||
|
||||
if(m_state == pushStreamUrl)
|
||||
emit sendUdpPushUrl(m_udpPushUrl, pushStreamUrl);
|
||||
else if(m_state == pullStreamUrl)
|
||||
emit sendUdpPushUrl(m_udpPushUrl, pullStreamUrl);
|
||||
saveParam2Ini();
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
#ifndef UDPPUSHDLG_H
|
||||
#define UDPPUSHDLG_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QSettings>
|
||||
|
||||
namespace Ui {
|
||||
class udpPushDlg;
|
||||
}
|
||||
|
||||
class udpPushDlg : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit udpPushDlg(QWidget *parent = nullptr);
|
||||
~udpPushDlg();
|
||||
|
||||
enum udpUrlType{ pullStreamUrl=0, pushStreamUrl=1};
|
||||
void setStateByPushOrPull(udpUrlType tpye); //设置推拉流状态
|
||||
private slots:
|
||||
void on_okPushBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::udpPushDlg *ui;
|
||||
QString m_udpPushUrl;//udp推流地址
|
||||
|
||||
void initLineEdit();
|
||||
void saveParam2Ini();
|
||||
void showParam4Ini();
|
||||
std::unique_ptr<QSettings> _configIni; //配置文件写入
|
||||
int m_state = -1; //推拉流状态初始化为-1
|
||||
signals:
|
||||
void sendErrorMessageSignal(QString message, int type);
|
||||
void sendUdpPushUrl(QString udpUrl, int index);
|
||||
};
|
||||
|
||||
#endif // UDPPUSHDLG_H
|
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>udpPushDlg</class>
|
||||
<widget class="QWidget" name="udpPushDlg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>网络设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" 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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<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="1" 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="3" column="1">
|
||||
<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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>局域网视频流网络设置</string>
|
||||
</property>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>57</y>
|
||||
<width>201</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>113</y>
|
||||
<width>51</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>端口号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>57</y>
|
||||
<width>36</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IP:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>113</y>
|
||||
<width>201</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="okPushBtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>169</y>
|
||||
<width>80</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,59 @@
|
||||
#include "udppushdlg.h"
|
||||
#include "ui_udppushdlg.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionValidator>
|
||||
|
||||
udpPushDlg::udpPushDlg(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::udpPushDlg)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setFixedSize(400,300);
|
||||
initLineEdit();
|
||||
}
|
||||
|
||||
udpPushDlg::~udpPushDlg()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void udpPushDlg::initLineEdit()
|
||||
{
|
||||
// 定义正则表达式:允许大写字母、小写字母、数字和特殊符号
|
||||
QRegularExpression regExp("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
|
||||
// 创建验证器
|
||||
QRegularExpressionValidator *validator = new QRegularExpressionValidator(regExp, this);
|
||||
|
||||
QRegularExpression rx("[0-9]+"); // 只允许数字
|
||||
QRegularExpressionValidator *validator1 = new QRegularExpressionValidator(rx, this);
|
||||
|
||||
// 设置验证器
|
||||
ui->lineEdit->setValidator(validator);
|
||||
ui->lineEdit_2->setValidator(validator1);
|
||||
}
|
||||
|
||||
//点击确定按钮
|
||||
void udpPushDlg::on_okPushBtn_clicked()
|
||||
{
|
||||
if(ui->lineEdit->text().isEmpty())
|
||||
{
|
||||
emit sendErrorMessageSignal("输入IP地址不能为空",3);
|
||||
return;
|
||||
}
|
||||
|
||||
if(ui->lineEdit_2->text().isEmpty())
|
||||
{
|
||||
emit sendErrorMessageSignal("输入端口号不能为空",3);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this->isVisible())
|
||||
this->hide();
|
||||
m_udpPushUrl = QString("udp://%1:%2").arg(ui->lineEdit->text()).arg(ui->lineEdit_2->text());
|
||||
emit sendUdpPushUrl(m_udpPushUrl, pushStreamUrl);
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
#ifndef UDPPUSHDLG_H
|
||||
#define UDPPUSHDLG_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class udpPushDlg;
|
||||
}
|
||||
|
||||
class udpPushDlg : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit udpPushDlg(QWidget *parent = nullptr);
|
||||
~udpPushDlg();
|
||||
|
||||
enum udpUrlType{ pullStreamUrl=0, pushStreamUrl=1};
|
||||
|
||||
private slots:
|
||||
void on_okPushBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::udpPushDlg *ui;
|
||||
QString m_udpPushUrl;//udp推流地址
|
||||
|
||||
void initLineEdit();
|
||||
signals:
|
||||
void sendErrorMessageSignal(QString message, int type);
|
||||
void sendUdpPushUrl(QString url, int index);
|
||||
};
|
||||
|
||||
#endif // UDPPUSHDLG_H
|
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>udpPushDlg</class>
|
||||
<widget class="QWidget" name="udpPushDlg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>网络设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" 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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<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="1" 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="3" column="1">
|
||||
<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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>局域网视频流网络设置</string>
|
||||
</property>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>57</y>
|
||||
<width>201</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>113</y>
|
||||
<width>51</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>端口号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>57</y>
|
||||
<width>36</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IP:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>113</y>
|
||||
<width>201</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="okPushBtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>169</y>
|
||||
<width>80</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -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,274 @@
|
||||
#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 = {"htsdfp1","123456","emergency"};
|
||||
userData u2 = {"htsdfp2","123456","seaRescue"};
|
||||
userData u3 = {"htsdfp3","123456","emergency"};
|
||||
list += {u1,u2,u3};
|
||||
|
||||
multipleInsertData(list);
|
||||
userData u4 = {"htsdfp4","123456","admin"};
|
||||
singleInsertData(u4);
|
||||
// deleteData("wanghaoyu4");
|
||||
// queryDataByUsername("wanghaoyu3");
|
||||
// userData u5 = {"wanghaoyu8","123456","yingji1"};
|
||||
// updateDataByUsername(u5,1);
|
||||
}
|
||||
|
||||
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 userData &data, const int &is_del)
|
||||
{
|
||||
if(!queryConuntByUsername(data.username))//根据用户名没有查询到数据-不进行更新操作 查询已有数据
|
||||
{
|
||||
return false;
|
||||
}
|
||||
database.transaction();
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("UPDATE user SET password=? ,scene=?, is_del=?, updated_at=(DATETIME('now', 'localtime')) WHERE username=? AND scene != 'admin'");
|
||||
sqlQuery.addBindValue(data.password);
|
||||
sqlQuery.addBindValue(data.scene);
|
||||
sqlQuery.addBindValue(is_del);
|
||||
sqlQuery.addBindValue(data.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, const int &isDel)
|
||||
{
|
||||
QSqlQuery sqlQuery;
|
||||
sqlQuery.prepare("SELECT * FROM user WHERE is_del = ? AND username=?");
|
||||
sqlQuery.addBindValue(isDel);
|
||||
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();
|
||||
|
||||
do{
|
||||
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);
|
||||
}while(sqlQuery.next());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyDatabase::queryConuntByUsername(const QString &username)
|
||||
{
|
||||
QSqlQuery checkQuery;
|
||||
checkQuery.prepare("SELECT COUNT(*) FROM user WHERE username=?");
|
||||
checkQuery.addBindValue(username);
|
||||
|
||||
if (!checkQuery.exec()) {
|
||||
qDebug() << "Error: Failed to execute count_query." << checkQuery.lastError();
|
||||
return false;
|
||||
}
|
||||
|
||||
//直接调用 next(),然后取值
|
||||
if (checkQuery.next()) {
|
||||
int count = checkQuery.value(0).toInt();
|
||||
qDebug() << "User count:" << count;
|
||||
|
||||
if (count == 0) {
|
||||
qDebug() << "Error: count = 0 Username does not exist.";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
qDebug() << "Error: Query returned no results.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
userData MyDatabase::getQueryUserData()
|
||||
{
|
||||
return _queryUserData;
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
#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 userData &data, const int &is_del);
|
||||
|
||||
//查询数据-isDel用于判断查询的数据是否是已经删除的数据
|
||||
bool queryDataByUsername(const QString &username, const int &isDel);
|
||||
|
||||
//查询用户名数据的数量
|
||||
bool queryConuntByUsername(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,310 @@
|
||||
#include "userlogin.h"
|
||||
#include "ui_userlogin.h"
|
||||
#include <QMessageBox>
|
||||
#include <QRegularExpressionValidator>
|
||||
#include <QLabel>
|
||||
#include "global.h"
|
||||
|
||||
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->stackedWidget_2->setObjectName("stackedWidget_2");
|
||||
ui->stackedWidget_2->setStyleSheet("QWidget {"
|
||||
"background-color: #363636;"
|
||||
"border-bottom-left-radius: 20px; "
|
||||
"border-bottom-right-radius: 20px;"
|
||||
"margin-left: 0px;"
|
||||
"margin-right: 0px;"
|
||||
"}");
|
||||
|
||||
|
||||
ui->userlineEdit->setStyleSheet("border-radius: 5px;");
|
||||
ui->passwordlineEdit->setStyleSheet("border-radius: 5px;");
|
||||
ui->loginButton->setStyleSheet(g_okButtonStyle);
|
||||
|
||||
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(g_loginButtonStyle);
|
||||
ui->pushButton_login->setStyleSheet(g_loginButtonStyle);
|
||||
ui->pushButton_register->setStyleSheet(g_loginButtonStyle);
|
||||
ui->label_2->setStyleSheet("font-size: 18px;"
|
||||
"color: #CFCFCF;");
|
||||
|
||||
//注册页面
|
||||
ui->registerButton->setStyleSheet(g_okButtonStyle);
|
||||
ui->senceComboBox->addItem("应急场景", QVariant("emergency"));
|
||||
ui->senceComboBox->addItem("海上救捞", QVariant("seaRescue"));
|
||||
ui->senceComboBox->setStyleSheet("QComboBox {"
|
||||
"border-radius: 5px;"/*圆角*/
|
||||
"}");
|
||||
|
||||
|
||||
|
||||
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())
|
||||
{
|
||||
showTopMessage("输入"+origins+"不能为空!", LOGINERROR);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 定义正则表达式:至少 8 个字符,且只能是大写字母、小写字母、数字和特殊符号
|
||||
QRegularExpression regExp("[A-Za-z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]{6,}");
|
||||
|
||||
// 检查输入内容
|
||||
if (!regExp.match(edit).hasMatch())
|
||||
{
|
||||
showTopMessage(origins +"至少输入 6 个字符,且只能包含大写字母、小写字母、数字和特殊符号!", LOGINERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::showTopMessage(QString message, MyNotifyType type)
|
||||
{
|
||||
if(g_notifyManager)
|
||||
{
|
||||
g_notifyManager->notify(message, "", type, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
bool UserLogin::queryDataByUsername(const QString &username)
|
||||
{
|
||||
if(dataBase.queryDataByUsername(username, 0))
|
||||
{
|
||||
_queryUserData = dataBase.getQueryUserData();
|
||||
if(_queryUserData.password == ui->passwordlineEdit->text())//密码匹配
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
showTopMessage("密码输入错误!", LOGINERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//用户名不存在
|
||||
showTopMessage("用户名不存在!", LOGINERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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(queryDataByUsername(ui->userlineEdit->text()))
|
||||
{
|
||||
//判断场景
|
||||
if(_queryUserData.scene == "emergency")
|
||||
{
|
||||
emit sendSenceData(use_sence::Emergency);
|
||||
//QMessageBox::information(NULL, "提示", "进入应急场景!");
|
||||
showTopMessage("进入应急场景!", LONGINSUCCESS);
|
||||
}
|
||||
else if(_queryUserData.scene == "seaRescue")
|
||||
{
|
||||
emit sendSenceData(use_sence::Sea_Rescue);
|
||||
showTopMessage("进入海上救捞场景!", LONGINSUCCESS);
|
||||
}
|
||||
else if(_queryUserData.scene == "admin")
|
||||
{
|
||||
showTopMessage("进入注册页面!", LONGINSUCCESS);
|
||||
ui->userlineEdit->setText("");
|
||||
ui->passwordlineEdit->setText("");
|
||||
ui->stackedWidget_2->setCurrentWidget(ui->page_register);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_pushButton_clicked()
|
||||
{
|
||||
emit loginDlgClick(click_type::HomePageClick);
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_exitButton_clicked()
|
||||
{
|
||||
emit loginDlgClick(click_type::ExitLogin);
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_pushButton_register_clicked()
|
||||
{
|
||||
showTopMessage("请输入管理员账号及密码!", LOGININFORMATION);
|
||||
if(!checkEditFormat(ui->userlineEdit->text(),"用户名"))
|
||||
return;
|
||||
if(!checkEditFormat(ui->passwordlineEdit->text(),"密码"))
|
||||
return;
|
||||
|
||||
//校验管理员账号
|
||||
if(queryDataByUsername(ui->userlineEdit->text()))
|
||||
{
|
||||
//判断场景
|
||||
if(_queryUserData.scene == "admin")
|
||||
{
|
||||
showTopMessage("进入注册页面!", LONGINSUCCESS);
|
||||
ui->stackedWidget_2->setCurrentWidget(ui->page_register);
|
||||
ui->userlineEdit->setText("");
|
||||
ui->passwordlineEdit->setText("");
|
||||
}
|
||||
else
|
||||
{
|
||||
showTopMessage("请输入管理员账号及密码!", LOGINERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_pushButton_login_clicked()
|
||||
{
|
||||
ui->stackedWidget_2->setCurrentWidget(ui->page_login);
|
||||
}
|
||||
|
||||
|
||||
void UserLogin::on_registerButton_clicked()
|
||||
{
|
||||
if(!checkEditFormat(ui->userlineEdit->text(),"用户名"))
|
||||
return;
|
||||
if(!checkEditFormat(ui->passwordlineEdit->text(),"密码"))
|
||||
return;
|
||||
|
||||
//查询用户名,用户名不存在方可注册 注意 注册的时候需要查询是否是被删掉的数据
|
||||
//先查询是否是数据库中已经删除的数据
|
||||
if(dataBase.queryDataByUsername(ui->userlineEdit->text(),1))
|
||||
{
|
||||
QVariant currentSenceData = ui->senceComboBox->currentData();//获取当前下拉列表数据
|
||||
userData registerUser = {ui->userlineEdit->text(),ui->passwordlineEdit->text(),currentSenceData.toString()};
|
||||
if(dataBase.updateDataByUsername(registerUser, 0))
|
||||
{
|
||||
showTopMessage("注册成功!", LONGINSUCCESS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!dataBase.queryDataByUsername(ui->userlineEdit->text(),0))
|
||||
{
|
||||
QVariant currentSenceData = ui->senceComboBox->currentData();//获取当前下拉列表数据
|
||||
userData registerUser = {ui->userlineEdit->text(),ui->passwordlineEdit->text(),currentSenceData.toString()};
|
||||
if(dataBase.singleInsertData(registerUser))
|
||||
{
|
||||
showTopMessage("注册成功!", LONGINSUCCESS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
showTopMessage("用户名已存在,请换一个!", LOGINERROR);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,116 @@
|
||||
#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
|
||||
AdminUser, //管理员用户
|
||||
};
|
||||
|
||||
enum click_type : unsigned char
|
||||
{
|
||||
HomePageClick = 0, //主页点击
|
||||
ExitLogin, //退出登录
|
||||
};
|
||||
|
||||
enum MyNotifyType : unsigned char
|
||||
{ LOGININFORMATION = 0,
|
||||
LONGINSUCCESS = 1,
|
||||
LOGINERROR = 2,
|
||||
LOGINWARNING = 3,
|
||||
};
|
||||
private slots:
|
||||
void on_loginButton_clicked();
|
||||
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_exitButton_clicked();
|
||||
|
||||
void on_pushButton_register_clicked();
|
||||
|
||||
void on_pushButton_login_clicked();
|
||||
|
||||
void on_registerButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::UserLogin *ui;
|
||||
MyDatabase dataBase;
|
||||
void initLineEdit();
|
||||
void initControls();
|
||||
bool checkEditFormat(const QString &edit, const QString &origins);
|
||||
void showTopMessage(QString message, MyNotifyType type);
|
||||
userData _queryUserData;
|
||||
QCheckBox *_passwordCheckBox;
|
||||
signals:
|
||||
void sendSenceData(use_sence sence);
|
||||
void loginDlgClick(int clickType);
|
||||
|
||||
public:
|
||||
bool queryDataByUsername(const QString &username);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
};
|
||||
|
||||
const QString g_loginButtonStyle = "QPushButton {"
|
||||
"border: none;" // 没有边框
|
||||
"color: #CFCFCF;" // 默认字体颜色为白色
|
||||
"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;" // 选中时字体颜色变为绿色
|
||||
"}";
|
||||
|
||||
const QString g_okButtonStyle = "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);" // 渐变背景
|
||||
"}";
|
||||
|
||||
#endif // USERLOGIN_H
|
@ -0,0 +1,808 @@
|
||||
<?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>869</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="2" 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">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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>
|
||||
<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>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>50</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>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_login">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<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>11</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>11</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
<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>11</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>11</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::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_register">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_18">
|
||||
<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>11</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="senceComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_19">
|
||||
<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>11</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_8">
|
||||
<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_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<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>11</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="registerButton">
|
||||
<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_17">
|
||||
<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>11</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>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" 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="2" 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="2" 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>
|
||||
<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="8">
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<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="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="5">
|
||||
<widget class="QPushButton" name="pushButton_login">
|
||||
<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="7">
|
||||
<widget class="QPushButton" name="pushButton_register">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>注册</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<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>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>|</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</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 |