# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'proc_addstaff_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.
import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *


class Ui_Proc_addStaff(object):
    def setupUi(self, Proc_addStaff):
        Proc_addStaff.setObjectName("Proc_addStaff")
        Proc_addStaff.resize(490, 696)
        self.layout_main = QtWidgets.QVBoxLayout(Proc_addStaff)
        self.layout_main.setSpacing(12)
        self.layout_main.setObjectName("layout_main")
        self.widget_getBasicInfo_container = QtWidgets.QWidget(Proc_addStaff)
        self.widget_getBasicInfo_container.setObjectName("widget_getBasicInfo_container")
        self.layout_top = QtWidgets.QGridLayout(self.widget_getBasicInfo_container)
        self.layout_top.setObjectName("layout_top")
        self.layout_getStaffInfo = QtWidgets.QGridLayout()
        self.layout_getStaffInfo.setObjectName("layout_getStaffInfo")
        self.LEdit_getId = QtWidgets.QLineEdit(self.widget_getBasicInfo_container)
        self.LEdit_getId.setObjectName("LEdit_getId")
        self.layout_getStaffInfo.addWidget(self.LEdit_getId, 1, 1, 1, 1)
        self.LEdit_getName = QtWidgets.QLineEdit(self.widget_getBasicInfo_container)
        self.LEdit_getName.setObjectName("LEdit_getName")
        self.layout_getStaffInfo.addWidget(self.LEdit_getName, 0, 1, 1, 1)
        self.label_getId = QtWidgets.QLabel(self.widget_getBasicInfo_container)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_getId.setFont(font)
        self.label_getId.setObjectName("label_getId")
        self.layout_getStaffInfo.addWidget(self.label_getId, 1, 0, 1, 1)
        self.label_getName = QtWidgets.QLabel(self.widget_getBasicInfo_container)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label_getName.setFont(font)
        self.label_getName.setObjectName("label_getName")
        self.layout_getStaffInfo.addWidget(self.label_getName, 0, 0, 1, 1)
        self.layout_top.addLayout(self.layout_getStaffInfo, 0, 0, 1, 1)
        self.layout_getStart = QtWidgets.QHBoxLayout()
        self.layout_getStart.setObjectName("layout_getStart")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.layout_getStart.addItem(spacerItem)
        self.btn_start = QtWidgets.QPushButton(self.widget_getBasicInfo_container)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.btn_start.setFont(font)
        self.btn_start.setObjectName("btn_start")
        self.layout_getStart.addWidget(self.btn_start)
        self.btn_finished = QtWidgets.QPushButton(self.widget_getBasicInfo_container)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.btn_finished.setFont(font)
        self.btn_finished.setObjectName("btn_finished")
        self.layout_getStart.addWidget(self.btn_finished)
        self.layout_top.addLayout(self.layout_getStart, 1, 0, 1, 1)
        self.layout_top.setRowStretch(0, 2)
        self.layout_top.setRowStretch(1, 1)
        self.layout_main.addWidget(self.widget_getBasicInfo_container)
        self.widget_getMoreInfo_container = QtWidgets.QWidget(Proc_addStaff)
        self.widget_getMoreInfo_container.setObjectName("widget_getMoreInfo_container")
        self.layout_bottom = QtWidgets.QGridLayout(self.widget_getMoreInfo_container)
        self.layout_bottom.setContentsMargins(14, 14, 14, 14)
        self.layout_bottom.setVerticalSpacing(10)
        self.layout_bottom.setObjectName("layout_bottom")
        self.widget_showCaptureFrames = QtWidgets.QWidget(self.widget_getMoreInfo_container)
        self.widget_showCaptureFrames.setObjectName("widget_showCaptureFrames")
        self.layout_widgetShowCaptureFrames = QtWidgets.QGridLayout(self.widget_showCaptureFrames)
        self.layout_widgetShowCaptureFrames.setObjectName("layout_widgetShowCaptureFrames")
        self.label_capture = QtWidgets.QLabel(self.widget_showCaptureFrames)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(18)
        font.setBold(True)
        font.setWeight(75)
        self.label_capture.setFont(font)
        self.label_capture.setAlignment(QtCore.Qt.AlignCenter)
        self.label_capture.setObjectName("label_capture")
        self.layout_widgetShowCaptureFrames.addWidget(self.label_capture, 0, 0, 1, 1)
        self.layout_bottom.addWidget(self.widget_showCaptureFrames, 0, 0, 1, 1)
        self.widget_showTips = QtWidgets.QWidget(self.widget_getMoreInfo_container)
        self.widget_showTips.setObjectName("widget_showTips")
        self.layout_widgetShowTips = QtWidgets.QHBoxLayout(self.widget_showTips)
        self.layout_widgetShowTips.setObjectName("layout_widgetShowTips")
        self.label_showNum_title = QtWidgets.QLabel(self.widget_showTips)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(14)
        font.setBold(True)
        font.setWeight(75)
        self.label_showNum_title.setFont(font)
        self.label_showNum_title.setObjectName("label_showNum_title")
        self.layout_widgetShowTips.addWidget(self.label_showNum_title)
        self.label_showNum_num = QtWidgets.QLabel(self.widget_showTips)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(14)
        font.setBold(True)
        font.setWeight(75)


        '''layout settings'''
        self.layout_bottom.setContentsMargins(5,5,5,5)
        self.layout_top.setContentsMargins(5,5,5,5)

        self.label_showNum_num.setFont(font)
        self.label_showNum_num.setAlignment(QtCore.Qt.AlignCenter)
        self.label_showNum_num.setObjectName("label_showNum_num")
        self.layout_widgetShowTips.addWidget(self.label_showNum_num)
        self.layout_bottom.addWidget(self.widget_showTips, 1, 0, 1, 1)
        self.layout_bottom.setRowStretch(0, 9)
        self.layout_bottom.setRowStretch(1, 1)
        self.layout_main.addWidget(self.widget_getMoreInfo_container)
        self.layout_main.setStretch(0, 3)
        self.layout_main.setStretch(1, 12)

        '''set line edit style'''
        with open("Qss/line_edit_style.qss") as LEditStyle:
            self.LEdit_getId.setStyleSheet(LEditStyle.read())
            LEditStyle.seek(0)
            self.LEdit_getName.setStyleSheet(LEditStyle.read())
            LEditStyle.seek(0)

        regx=QtCore.QRegExp("[0-9]+$")
        validator=QtGui.QRegExpValidator(regx, self.LEdit_getId)
        self.LEdit_getId.setValidator(validator)

        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei UI")
        font.setPointSize(11)
        font.setBold(True)
        self.LEdit_getId.setFont(font)
        self.LEdit_getName.setFont(font)

        '''enhance shadow effects'''
        self.setShadowEffects(self.widget_getBasicInfo_container)
        self.setShadowEffects(self.widget_getMoreInfo_container)
        self.setShadowEffects(self.widget_showCaptureFrames)

        '''set btn style'''
        with open("Qss/push_button_style_lightblue.qss") as BtnStyle:
            self.btn_start.setStyleSheet(BtnStyle.read())

        with open("Qss/push_button_style.qss") as BtnStyle:
            self.btn_finished.setStyleSheet(BtnStyle.read())

        self.retranslateUi(Proc_addStaff)
        QtCore.QMetaObject.connectSlotsByName(Proc_addStaff)

    def retranslateUi(self, Proc_addStaff):
        _translate = QtCore.QCoreApplication.translate
        Proc_addStaff.setWindowTitle(_translate("Proc_addStaff", "Form"))
        self.label_getId.setText(_translate("Proc_addStaff", "请输入员工ID:"))
        self.label_getName.setText(_translate("Proc_addStaff", "请输入员工姓名:"))
        self.btn_start.setText(_translate("Proc_addStaff", "开始添加员工"))
        self.btn_finished.setText(_translate("Proc_addStaff", "添加完成"))
        #self.label_capture.setText(_translate("Proc_addStaff", "摄像头在此"))
        self.label_showNum_title.setText(_translate("Proc_addStaff", "请读出以下数字："))
        self.label_showNum_num.setText(_translate("Proc_addStaff", "1234"))

    def setShadowEffects(self, widget, rgba="rgba(255, 255, 255, 130)"):
        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        widget.setGraphicsEffect(shadow_effect)
        widget.setStyleSheet("""QWidget#"""+widget.objectName()+"""{
                                background-color: """+rgba+""";
                                border-radius: 8px}""")

if __name__ == "__main__":
    app = QApplication( sys.argv )
    
    TestUi=QWidget()
    TestUi.main_ui=Ui_Proc_addStaff()
    TestUi.main_ui.setupUi(TestUi)
    TestUi.show()

    sys.exit( app.exec_() )