修改样式
This commit is contained in:
@@ -3,7 +3,8 @@ import sys
|
||||
from PySide6.QtCore import Signal
|
||||
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QApplication, QGridLayout
|
||||
from qfluentwidgets import PushButton, SpinBox, PrimaryPushButton, \
|
||||
BodyLabel, CommandBarView, Action, FluentIcon, Flyout, FlyoutAnimationType
|
||||
BodyLabel, CardWidget, SimpleCardWidget, FluentStyleSheet
|
||||
from qfluentwidgets.components.widgets.card_widget import CardSeparator
|
||||
|
||||
from ui.components.widget import RollingTextWidget
|
||||
|
||||
@@ -66,26 +67,33 @@ class QuickScoring(QWidget):
|
||||
self.submitButton.clicked.connect(lambda: self.submitSignal.emit(self.gradeSpinBox.value()))
|
||||
|
||||
|
||||
class PickStudentLabelUi(QWidget):
|
||||
class PickStudentLabelUi(SimpleCardWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.vBoxLayout = QVBoxLayout(self)
|
||||
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.rollingText = RollingTextWidget(self)
|
||||
self.scoring = QuickScoring(self)
|
||||
self.separator = CardSeparator(self)
|
||||
|
||||
self.scoring.hide()
|
||||
self.separator.hide()
|
||||
|
||||
self.vBoxLayout.addWidget(self.rollingText)
|
||||
self.vBoxLayout.addWidget(self.separator)
|
||||
self.vBoxLayout.addWidget(self.scoring)
|
||||
self.vBoxLayout.addStretch()
|
||||
|
||||
def show_scoring(self):
|
||||
self.scoring.show()
|
||||
self.separator.show()
|
||||
|
||||
def hideEvent(self, event, /):
|
||||
super().hideEvent(event)
|
||||
self.scoring.gradeSpinBox.clear()
|
||||
self.scoring.hide()
|
||||
self.separator.hide()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user