单一题号转为图片功能现可自由输入前缀信息
This commit is contained in:
parent
bee6b52377
commit
21ffb28195
|
|
@ -22,7 +22,7 @@ class Ui_Form(object):
|
||||||
def setupUi(self, Form):
|
def setupUi(self, Form):
|
||||||
if not Form.objectName():
|
if not Form.objectName():
|
||||||
Form.setObjectName(u"Form")
|
Form.setObjectName(u"Form")
|
||||||
Form.resize(278, 69)
|
Form.resize(278, 97)
|
||||||
self.label = QLabel(Form)
|
self.label = QLabel(Form)
|
||||||
self.label.setObjectName(u"label")
|
self.label.setObjectName(u"label")
|
||||||
self.label.setGeometry(QRect(10, 10, 31, 16))
|
self.label.setGeometry(QRect(10, 10, 31, 16))
|
||||||
|
|
@ -41,6 +41,12 @@ class Ui_Form(object):
|
||||||
self.pushButton_open = QPushButton(Form)
|
self.pushButton_open = QPushButton(Form)
|
||||||
self.pushButton_open.setObjectName(u"pushButton_open")
|
self.pushButton_open.setObjectName(u"pushButton_open")
|
||||||
self.pushButton_open.setGeometry(QRect(200, 10, 75, 51))
|
self.pushButton_open.setGeometry(QRect(200, 10, 75, 51))
|
||||||
|
self.label_3 = QLabel(Form)
|
||||||
|
self.label_3.setObjectName(u"label_3")
|
||||||
|
self.label_3.setGeometry(QRect(10, 70, 51, 16))
|
||||||
|
self.lineEdit_message = QLineEdit(Form)
|
||||||
|
self.lineEdit_message.setObjectName(u"lineEdit_message")
|
||||||
|
self.lineEdit_message.setGeometry(QRect(70, 70, 201, 20))
|
||||||
|
|
||||||
self.retranslateUi(Form)
|
self.retranslateUi(Form)
|
||||||
|
|
||||||
|
|
@ -53,5 +59,7 @@ class Ui_Form(object):
|
||||||
self.label_2.setText(QCoreApplication.translate("Form", u"DPI", None))
|
self.label_2.setText(QCoreApplication.translate("Form", u"DPI", None))
|
||||||
self.pushButton_convert.setText(QCoreApplication.translate("Form", u"\u8f6c\u6362", None))
|
self.pushButton_convert.setText(QCoreApplication.translate("Form", u"\u8f6c\u6362", None))
|
||||||
self.pushButton_open.setText(QCoreApplication.translate("Form", u"\u6253\u5f00", None))
|
self.pushButton_open.setText(QCoreApplication.translate("Form", u"\u6253\u5f00", None))
|
||||||
|
self.label_3.setText(QCoreApplication.translate("Form", u"\u9644\u52a0\u6587\u5b57", None))
|
||||||
|
self.lineEdit_message.setPlaceholderText(QCoreApplication.translate("Form", u"\u8f93\u5165\u9644\u52a0\u6587\u5b57, \u7559\u7a7a\u8868\u793a\u65e0\u9644\u52a0\u6587\u5b57", None))
|
||||||
# retranslateUi
|
# retranslateUi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ class MyWindow(QWidget,Ui_Form):
|
||||||
self.id = self.lineEdit_ID.text()
|
self.id = self.lineEdit_ID.text()
|
||||||
self.dpi = self.lineEdit_dpi.text()
|
self.dpi = self.lineEdit_dpi.text()
|
||||||
pro_dict = load_dict("../题库0.3/Problems.json")
|
pro_dict = load_dict("../题库0.3/Problems.json")
|
||||||
content = pro_dict[self.id.zfill(6)]["content"]
|
prefix = self.lineEdit_message.text().strip()
|
||||||
|
content = f"{prefix} {pro_dict[self.id.zfill(6)]['content']}"
|
||||||
latex_raw = ReadTextFile("模板文件/独立文件模板.txt")
|
latex_raw = ReadTextFile("模板文件/独立文件模板.txt")
|
||||||
latexdata = StringSubstitute(r"<<待替换\d*>>",latex_raw,[content])
|
latexdata = StringSubstitute(r"<<待替换\d*>>",latex_raw,[content])
|
||||||
makedir("临时文件/pics")
|
makedir("临时文件/pics")
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>278</width>
|
<width>278</width>
|
||||||
<height>69</height>
|
<height>97</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -85,6 +85,32 @@
|
||||||
<string>打开</string>
|
<string>打开</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>51</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>附加文字</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="lineEdit_message">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>70</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>201</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>输入附加文字, 留空表示无附加文字</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
||||||
Reference in New Issue