Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦醒贰零壹柒
RMS
提交
ebc51440
R
RMS
项目概览
梦醒贰零壹柒
/
RMS
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RMS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
ebc51440
编写于
12月 18, 2021
作者:
梦醒贰零壹柒
提交者:
GitHub
12月 18, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #45 from mengxing2017/40-reconstruct-login-ui
40 reconstruct login UI
上级
0a623cb7
5528322b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
68 addition
and
77 deletion
+68
-77
src/rms/sources/main.cpp
src/rms/sources/main.cpp
+5
-0
src/rms/sources/slot/login_slot.cpp
src/rms/sources/slot/login_slot.cpp
+0
-1
src/rms/sources/ui/login_dlg_ui.cpp
src/rms/sources/ui/login_dlg_ui.cpp
+58
-70
src/rms/sources/ui/login_dlg_ui.h
src/rms/sources/ui/login_dlg_ui.h
+5
-6
未找到文件。
src/rms/sources/main.cpp
浏览文件 @
ebc51440
...
...
@@ -2,6 +2,7 @@
#include <QDir>
#include <QFile>
#include <QStandardPaths>
#include <QTextCodec>
#include <QtDebug>
#include "mainwindow.h"
...
...
@@ -9,6 +10,10 @@
#include "slot/login_slot.h"
int
main
(
int
argc
,
char
*
argv
[])
{
QTextCodec
::
setCodecForLocale
(
QTextCodec
::
codecForName
(
"utf8"
));
QTextCodec
::
setCodecForLocale
(
QTextCodec
::
codecForName
(
"utf8"
));
QApplication
a
(
argc
,
argv
);
InitDbService
*
initDb
=
new
InitDbService
();
...
...
src/rms/sources/slot/login_slot.cpp
浏览文件 @
ebc51440
...
...
@@ -6,7 +6,6 @@ LoginSlot::LoginSlot() {
connect
(
ui
->
loginBt
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
loginClicked
()));
connect
(
ui
->
quitBt
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
closeClicked
()));
connect
(
ui
->
closeBt
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
closeClicked
()));
}
void
LoginSlot
::
show
()
{
ui
->
exec
();
}
...
...
src/rms/sources/ui/login_dlg_ui.cpp
浏览文件 @
ebc51440
...
...
@@ -8,93 +8,80 @@ LoginDlgUi::LoginDlgUi(QWidget *parent) : QDialog(parent) {
this
->
setWindowTitle
(
"登录窗口"
);
//登录框大小
this
->
resize
(
420
,
320
);
//调色板
QPalette
LoginPal
(
this
->
palette
());
//设置背景图片
LoginPal
.
setBrush
(
QPalette
::
Window
,
QBrush
(
QPixmap
(
":/icon/res/images/login_background.jpeg"
)));
this
->
setAutoFillBackground
(
true
);
this
->
setPalette
(
LoginPal
);
this
->
resize
(
1000
,
480
);
this
->
setWindowFlags
(
Qt
::
FramelessWindowHint
);
// 顶部
top
=
new
QWidget
(
this
);
top
->
setObjectName
(
QStringLiteral
(
"layoutWidget_top"
));
top
->
setGeometry
(
QRect
(
0
,
0
,
420
,
180
));
// 底部
bottom
=
new
QWidget
(
this
);
bottom
->
setObjectName
(
QStringLiteral
(
"layoutWidget_bottom"
));
bottom
->
setGeometry
(
QRect
(
120
,
210
,
180
,
90
));
// 垂直布局盒子
vLayout
=
new
QVBoxLayout
(
bottom
);
vLayout
->
setObjectName
(
QStringLiteral
(
"verticalLayout"
));
vLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
// 网格布局
gridLayout
=
new
QGridLayout
();
gridLayout
->
setObjectName
(
QStringLiteral
(
"gridLayout"
));
left
=
new
QWidget
(
this
);
left
->
setGeometry
(
QRect
(
0
,
0
,
480
,
480
));
left
->
setStyleSheet
(
"background-color: rgb(166,211,255);"
);
softName
=
new
QWidget
(
left
);
softName
->
setGeometry
(
85
,
180
,
310
,
120
);
softCnNameLb
=
new
QLabel
(
softName
);
softCnNameLb
->
setGeometry
(
0
,
0
,
310
,
54
);
softCnNameLb
->
setAlignment
(
Qt
::
AlignHCenter
);
softCnNameLb
->
setStyleSheet
(
"color:white;"
);
QFont
softCnNameFont
;
softCnNameFont
.
setPixelSize
(
40
);
softCnNameFont
.
setFamily
(
"宋体"
);
softCnNameLb
->
setFont
(
softCnNameFont
);
welcomeLb
=
new
QLabel
(
softName
);
welcomeLb
->
setGeometry
(
0
,
75
,
310
,
44
);
welcomeLb
->
setAlignment
(
Qt
::
AlignHCenter
);
welcomeLb
->
setStyleSheet
(
"color:white;"
);
QFont
welcomeFont
;
welcomeFont
.
setPixelSize
(
20
);
welcomeFont
.
setFamily
(
"宋体"
);
welcomeLb
->
setFont
(
welcomeFont
);
welcomeLoginLb
=
new
QLabel
(
this
);
welcomeLoginLb
->
setGeometry
(
635
,
85
,
160
,
40
);
QFont
welcomeLoginFont
;
welcomeLoginFont
.
setFamily
(
"宋体"
);
welcomeLoginFont
.
setPixelSize
(
40
);
welcomeLoginLb
->
setFont
(
welcomeLoginFont
);
// 通用字体
QFont
commonFont
;
commonFont
.
setFamily
(
"宋体"
);
commonFont
.
setPixelSize
(
20
);
// 用户名标签
usernameLb
=
new
QLabel
(
bottom
);
usernameLb
=
new
QLabel
(
this
);
usernameLb
->
setObjectName
(
QStringLiteral
(
"label_UserName"
));
usernameLb
->
setGeometry
(
1
,
1
,
40
,
26
);
gridLayout
->
addWidget
(
usernameLb
,
0
,
0
,
1
,
1
);
usernameLb
->
setGeometry
(
635
,
185
,
40
,
20
);
usernameLb
->
setFont
(
commonFont
);
// 用户名输入框
usernameLe
=
new
QLineEdit
(
bottom
);
usernameLe
=
new
QLineEdit
(
this
);
usernameLe
->
setObjectName
(
QStringLiteral
(
"lineEdit_UserName"
));
usernameLe
->
setGeometry
(
47
,
1
,
128
,
26
);
gridLayout
->
addWidget
(
usernameLe
,
0
,
1
,
1
,
1
);
usernameLe
->
setGeometry
(
635
,
210
,
270
,
40
);
//密码标签
passwordLb
=
new
QLabel
(
bottom
);
passwordLb
=
new
QLabel
(
this
);
passwordLb
->
setObjectName
(
QStringLiteral
(
"label_Password"
));
passwordLb
->
setGeometry
(
1
,
33
,
40
,
26
);
gridLayout
->
addWidget
(
passwordLb
,
1
,
0
,
1
,
1
);
passwordLb
->
setGeometry
(
635
,
255
,
40
,
20
);
passwordLb
->
setFont
(
commonFont
);
// 密码输入框
passwordLe
=
new
QLineEdit
(
bottom
);
passwordLe
=
new
QLineEdit
(
this
);
passwordLe
->
setObjectName
(
QStringLiteral
(
"lineEdit_Password"
));
passwordLe
->
setEchoMode
(
QLineEdit
::
Password
);
passwordLe
->
setGeometry
(
47
,
33
,
128
,
26
);
gridLayout
->
addWidget
(
passwordLe
,
1
,
1
,
1
,
1
);
vLayout
->
addLayout
(
gridLayout
);
//水平布局
hLayout
=
new
QHBoxLayout
();
hLayout
->
setObjectName
(
QStringLiteral
(
"horizontalLayout"
));
passwordLe
->
setGeometry
(
635
,
280
,
270
,
40
);
// 登录按钮
loginBt
=
new
QPushButton
(
bottom
);
loginBt
=
new
QPushButton
(
this
);
loginBt
->
setObjectName
(
QStringLiteral
(
"button_Login"
));
loginBt
->
setGeometry
(
1
,
1
,
84
,
26
);
hLayout
->
addWidget
(
loginBt
);
loginBt
->
setGeometry
(
635
,
380
,
80
,
40
);
loginBt
->
setFont
(
commonFont
);
//退出按钮
quitBt
=
new
QPushButton
(
bottom
);
quitBt
=
new
QPushButton
(
this
);
quitBt
->
setObjectName
(
QStringLiteral
(
"button_Quit"
));
quitBt
->
setGeometry
(
91
,
1
,
86
,
26
);
hLayout
->
addWidget
(
quitBt
);
vLayout
->
addLayout
(
hLayout
);
// 关闭按钮
closeBt
=
new
QPushButton
(
this
);
closeBt
->
setObjectName
(
QStringLiteral
(
"button_Close"
));
closeBt
->
setGeometry
(
395
,
0
,
25
,
25
);
QIcon
closeIcon
;
closeIcon
.
addFile
(
":/icon/res/images/close.jpeg"
);
closeBt
->
setIcon
(
closeIcon
);
quitBt
->
setGeometry
(
825
,
380
,
80
,
40
);
quitBt
->
setFont
(
commonFont
);
QMetaObject
::
connectSlotsByName
(
this
);
...
...
@@ -105,10 +92,11 @@ LoginDlgUi::LoginDlgUi(QWidget *parent) : QDialog(parent) {
void
LoginDlgUi
::
retranslateUi
(
QDialog
*
LoginDialog
)
{
LoginDialog
->
setWindowTitle
(
QApplication
::
translate
(
"LoginDialog"
,
"Dialog"
,
nullptr
));
usernameLb
->
setText
(
QApplication
::
translate
(
"LoginDialog"
,
"
\347\224\250\346\210\267\345\220\215
:"
,
nullptr
));
passwordLb
->
setText
(
QApplication
::
translate
(
"LoginDialog"
,
"
\345\257\206\347\240\201
:"
,
nullptr
));
softCnNameLb
->
setText
(
QObject
::
tr
(
"RMS餐饮管理系统"
));
welcomeLb
->
setText
(
QObject
::
tr
(
"Welcome to RMS System"
));
welcomeLoginLb
->
setText
(
QObject
::
tr
(
"欢迎登录"
));
usernameLb
->
setText
(
QObject
::
tr
(
"账号"
));
passwordLb
->
setText
(
QObject
::
tr
(
"密码"
));
loginBt
->
setText
(
QApplication
::
translate
(
"LoginDialog"
,
"
\347\231\273\345\275\225
"
,
nullptr
));
quitBt
->
setText
(
QApplication
::
translate
(
"LoginDialog"
,
...
...
src/rms/sources/ui/login_dlg_ui.h
浏览文件 @
ebc51440
...
...
@@ -30,19 +30,18 @@ class LoginDlgUi : public QDialog {
public:
explicit
LoginDlgUi
(
QWidget
*
parent
=
nullptr
);
QWidget
*
top
;
QWidget
*
bottom
;
QVBoxLayout
*
vLayout
;
QGridLayout
*
gridLayout
;
QHBoxLayout
*
hLayout
;
QWidget
*
left
;
QWidget
*
softName
;
QLabel
*
softCnNameLb
;
QLabel
*
welcomeLb
;
QLabel
*
welcomeLoginLb
;
QLabel
*
usernameLb
;
//用户名标签
QLineEdit
*
usernameLe
;
//用户名输入框
QLabel
*
passwordLb
;
//密码标签
QLineEdit
*
passwordLe
;
//密码输入框
QPushButton
*
loginBt
;
//登录按钮
QPushButton
*
quitBt
;
//退出按钮
QPushButton
*
closeBt
;
//关闭按钮
void
setupUi
(
QDialog
*
LoginDialog
);
// setupUi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录