添加下载模板功能
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
from PySide6.QtCore import Qt, Signal, QTimer
|
||||
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout, QWidget, QFileDialog
|
||||
from qfluentwidgets import GroupHeaderCardWidget, PushButton, FluentIcon, PrimaryPushButton, IconWidget, BodyLabel, \
|
||||
SpinBox
|
||||
from qfluentwidgets import PushButton, FluentIcon, PrimaryPushButton, IconWidget, BodyLabel, \
|
||||
SpinBox, HyperlinkButton
|
||||
|
||||
from module.picker.schema import PickerExcel, PickerStudent
|
||||
from ui import MAIN_THEME_COLOR
|
||||
from ui.components.widget import Widget
|
||||
from ui.components.widget import Widget, MyGroupHeaderCardWidget
|
||||
from ui.pyui.sub.picker import PickStudentLabelUi
|
||||
from utils.function import open_template
|
||||
|
||||
|
||||
class PickStudentMode(QWidget):
|
||||
@@ -15,10 +16,12 @@ class PickStudentMode(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.card = GroupHeaderCardWidget(self)
|
||||
self.card = MyGroupHeaderCardWidget(self)
|
||||
self.vbox = QVBoxLayout(self)
|
||||
self.vbox.setContentsMargins(0, 0, 0, 0)
|
||||
self.btnHBox = QHBoxLayout(self)
|
||||
|
||||
self.openTemplateBtn = HyperlinkButton("", "下载模板")
|
||||
self.chooseBtn = PushButton("打开")
|
||||
self.startButton = PrimaryPushButton(FluentIcon.PLAY_SOLID, "开始")
|
||||
self.bottomLayout = QHBoxLayout()
|
||||
@@ -45,8 +48,10 @@ class PickStudentMode(QWidget):
|
||||
self.bottomLayout.addStretch(1)
|
||||
self.bottomLayout.addWidget(self.startButton, 0, Qt.AlignRight)
|
||||
self.bottomLayout.setAlignment(Qt.AlignVCenter)
|
||||
self.btnHBox.addWidget(self.openTemplateBtn)
|
||||
self.btnHBox.addWidget(self.chooseBtn)
|
||||
|
||||
self.group = self.card.addGroup(FluentIcon.DOCUMENT, "学生名单", "选择学生名单", self.chooseBtn)
|
||||
self.group = self.card.addGroup(FluentIcon.DOCUMENT, "学生名单", "选择学生名单", self.btnHBox)
|
||||
self.spinGroup = self.card.addGroup(FluentIcon.SETTING, "提问次数", "设置提问的最大次数", self.spinbox)
|
||||
self.spinGroup.setSeparatorVisible(True)
|
||||
self.card.vBoxLayout.addLayout(self.bottomLayout)
|
||||
@@ -60,6 +65,7 @@ class PickStudentMode(QWidget):
|
||||
self.spinbox.valueChanged.connect(lambda: PickerExcel.save_total_time(value=self.spinbox.value()))
|
||||
self.startButton.clicked.connect(self.start_rolling)
|
||||
self.psui.rollingText.finishSignal.connect(self.finish_rolling)
|
||||
self.openTemplateBtn.clicked.connect(lambda: open_template("template-pick-student.xlsm", self))
|
||||
# ==============================
|
||||
self.filepath = ""
|
||||
self.students = []
|
||||
|
||||
Reference in New Issue
Block a user