LISHUZUOXUN_yangjiang/LSZXPagesManagerLibrary/score_page_widget_define.py

170 lines
5.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: gb2312
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
from BaseFrontend.based_widget import BasedWidget
class ScorePageWidgetDefine(BasedWidget):
def __init__(self):
super().__init__()
# 定义控件按Ctrl+点击快速跳转编辑)
"""**布局对象初始化区**布局对象初始化区**布局对象初始化区**布局对象初始化区**布局对象初始化区**布局对象初始化区"""
# 班级标题
self.class_title = self._init_class_title_widget()
# 班级下拉框
self.class_combobox = self._init_class_combobox()
# 姓名标题
self.name_title = self._init_name_title_widget()
# 姓名输入框
self.name_editbox = self._init_name_editbox()
# 批次标题
self.batch_title = self._init_batch_title_widget()
# 批次下拉框
self.batch_combobox = self._init_batch_combobox()
# 清空成绩按钮
self.clear_score_button = self._init_clear_score_button()
# Excel导出成绩按钮
self.excel_export_score_button = self._init_excel_export_score_button()
# 成绩同步按钮
self.score_synchronization_button = self._init_score_synchronization_button()
# 表格
self.table_widget = self._init_table_widget()
# self.table_widget = QWidget()
# 初始化空白控件
@staticmethod
def init_empty_widget():
empty_widget = QFrame()
return empty_widget
@staticmethod
def _init_class_title_widget():
class_title = QLabel("班级:")
class_title.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
class_title.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
)
return class_title
@staticmethod
def _init_class_combobox():
class_combobox = QComboBox()
class_combobox.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
"padding-left: 15px;"
)
return class_combobox
@staticmethod
def _init_name_title_widget():
action_difficulty_title = QLabel("姓名:")
action_difficulty_title.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
action_difficulty_title.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
)
return action_difficulty_title
@staticmethod
def _init_name_editbox():
name_editbox = QLineEdit()
name_editbox.setPlaceholderText("请输入姓名")
name_editbox.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
"padding-left: 15px;"
)
return name_editbox
@staticmethod
def _init_batch_title_widget():
batch_title = QLabel("批次:")
batch_title.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
batch_title.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
)
return batch_title
@staticmethod
def _init_batch_combobox():
batch_combobox = QComboBox()
batch_combobox.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
"padding-left: 15px;"
)
return batch_combobox
@staticmethod
def _init_clear_score_button():
clear_score_button = QPushButton("清空所有成绩")
clear_score_button.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
)
return clear_score_button
@staticmethod
def _init_score_synchronization_button():
score_synchronization_button = QPushButton("成绩同步")
score_synchronization_button.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
)
return score_synchronization_button
@staticmethod
def _init_excel_export_score_button():
excel_export_score_button = QPushButton("Excel导出成绩")
excel_export_score_button.setStyleSheet(
"font: 24px \"Microsoft YaHei UI\";"
"color: #222222;"
"letter-spacing: 4px;"
"border: 1px solid #222222;"
"border-radius: 4px;"
"padding-top: 15px;"
"padding-bottom: 15px;"
)
return excel_export_score_button
@staticmethod
def _init_table_widget():
table_widget = QTableWidget()
table_widget.setStyleSheet(
"font: 18px \"Microsoft YaHei UI\";"
)
return table_widget