完善提问模块

This commit is contained in:
2025-06-25 23:18:32 +08:00
parent 64f226c714
commit b845b5994a
6 changed files with 354 additions and 22 deletions

View File

@@ -20,21 +20,22 @@ class MainWindow(MSFluentWindow):
self.achievementInterface = AchievementWidget('Achievement Interface', self)
self.defenseInterface = DefenseWidget('Defense Interface', self)
self.aboutInterface = AboutWidget('About Interface', self)
self.pickerInterface = PickerWidget('Picker Interface', self)
if not DEVELOPMENT_ENV:
self.pickerInterface = PickerWidget('Picker Interface', self)
self.testInterface = TestWidget('Test Interface', self)
self.achievementInterface.error.connect(self.showError)
self.defenseInterface.errorSignal.connect(self.showError)
self.pickerInterface.errorSignal.connect(self.showError)
self.initNavigation()
self.initWindow()
def initNavigation(self):
self.addSubInterface(self.achievementInterface, FluentIcon.SPEED_HIGH, '达成度')
self.addSubInterface(self.defenseInterface, FluentIcon.FEEDBACK, '答辩')
self.addSubInterface(self.defenseInterface, FluentIcon.FEEDBACK, '答辩题目')
self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '提问')
if not DEVELOPMENT_ENV:
self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '抽答')
self.addSubInterface(self.testInterface, FluentIcon.VIEW, '测试')
self.addSubInterface(self.aboutInterface, FluentIcon.INFO, '关于', position=NavigationItemPosition.BOTTOM)
@@ -45,7 +46,10 @@ class MainWindow(MSFluentWindow):
self.setWindowIcon(QIcon(':/images/logo.png'))
def showError(self, title: str, message: str):
MessageBox(title, message, self).exec()
box = MessageBox(title, message, self)
box.yesButton.setText("关闭")
box.cancelButton.hide()
box.exec()
def showEvent(self, event: QShowEvent):
super().showEvent(event)