文本转换处理功能添加 显示LaTeX模板

This commit is contained in:
weiye.wang 2024-06-22 15:20:42 +08:00
parent 3954fa4281
commit 16111a5bdd
3 changed files with 18 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class Ui_Form(object):
self.pushButton_convert.setFont(font)
self.layoutWidget = QWidget(Form)
self.layoutWidget.setObjectName(u"layoutWidget")
self.layoutWidget.setGeometry(QRect(330, 100, 97, 126))
self.layoutWidget.setGeometry(QRect(330, 90, 97, 152))
self.verticalLayout = QVBoxLayout(self.layoutWidget)
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
@ -74,6 +74,11 @@ class Ui_Form(object):
self.verticalLayout.addWidget(self.radioButton_answers)
self.radioButton_template = QRadioButton(self.layoutWidget)
self.radioButton_template.setObjectName(u"radioButton_template")
self.verticalLayout.addWidget(self.radioButton_template)
self.retranslateUi(Form)
@ -92,5 +97,6 @@ class Ui_Form(object):
self.radioButton_multiple.setText(QCoreApplication.translate("Form", u"\u591a\u9009\u8f6c\u586b\u7a7a", None))
self.radioButton_puctuations.setText(QCoreApplication.translate("Form", u"\u6807\u70b9\u8f6c\u534a\u89d2", None))
self.radioButton_answers.setText(QCoreApplication.translate("Form", u"\u5df2\u6709\u7b54\u6848\u6807\u7ea2", None))
self.radioButton_template.setText(QCoreApplication.translate("Form", u"LaTeX\u6a21\u677f", None))
# retranslateUi

View File

@ -34,6 +34,8 @@ class MyWindow_wbzh(QWidget,Ui_Form):
self.mycursor = self.mydb.cursor()
self.pro_dict = generateProDict(self.mycursor)
dest_string = PaintRedAnswers(raw_string,self.pro_dict)
elif self.radioButton_template.isChecked():
dest_string = ReadTextFile("./模板文件/题目编辑.txt")
self.plainTextEdit_dest.setPlainText(dest_string)
self.mydb.close()

View File

@ -93,9 +93,9 @@
<property name="geometry">
<rect>
<x>330</x>
<y>100</y>
<y>90</y>
<width>97</width>
<height>126</height>
<height>152</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -134,6 +134,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_template">
<property name="text">
<string>LaTeX模板</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>