迁移 获取题号
This commit is contained in:
parent
aec6abdf6e
commit
01329bae69
|
|
@ -0,0 +1,62 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '获取题号.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPlainTextEdit,
|
||||
QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(10, 10, 54, 16))
|
||||
self.pushButton_selectfilepath = QPushButton(Form)
|
||||
self.pushButton_selectfilepath.setObjectName(u"pushButton_selectfilepath")
|
||||
self.pushButton_selectfilepath.setGeometry(QRect(670, 10, 75, 24))
|
||||
self.plainTextEdit = QPlainTextEdit(Form)
|
||||
self.plainTextEdit.setObjectName(u"plainTextEdit")
|
||||
self.plainTextEdit.setGeometry(QRect(10, 100, 741, 361))
|
||||
self.plainTextEdit.setReadOnly(True)
|
||||
self.lineEdit = QLineEdit(Form)
|
||||
self.lineEdit.setObjectName(u"lineEdit")
|
||||
self.lineEdit.setGeometry(QRect(10, 40, 741, 20))
|
||||
self.lineEdit.setReadOnly(True)
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(10, 80, 54, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(670, 70, 75, 24))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u83b7\u53d6\u9898\u53f7", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.pushButton_selectfilepath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u9898\u53f7", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u83b7\u53d6\u9898\u53f7", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -7,6 +7,7 @@ from 文本转换处理 import MyWindow_wbzh
|
|||
from 系列讲义生成 import MyWindow_jysc
|
||||
from 讲义结构与内容录入 import MyWindow_jglr
|
||||
from 答题纸对应 import MyWindow_dtlr
|
||||
from 获取题号 import MyWindow_hqth
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow(QMainWindow,Ui_MainWindow):
|
||||
|
|
@ -26,7 +27,9 @@ class MyWindow(QMainWindow,Ui_MainWindow):
|
|||
self.kxth = MyWindow_kxth(self.database)
|
||||
self.layout_kxth.addWidget(self.kxth) #以上三行为初始化“空闲题号”tab
|
||||
|
||||
|
||||
self.layout_hqth = QVBoxLayout(self.tab_hqth)
|
||||
self.hqth = MyWindow_hqth()
|
||||
self.layout_hqth.addWidget(self.hqth) #以上三行为初始化“空闲题号”tab
|
||||
|
||||
self.layout_jglr = QVBoxLayout(self.tab_jglr)
|
||||
self.jglr = MyWindow_jglr()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_获取题号 import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_hqth(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.pushButton_exec.setDisabled(True)
|
||||
self.pushButton_selectfilepath.clicked.connect(self.selectfilepath)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def selectfilepath(self):
|
||||
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件或.pdf文件",os.getcwd(),"tex或pdf文件(*.tex *.pdf);;所有文件(*)")[0]
|
||||
self.lineEdit.setText(self.filepath)
|
||||
self.pushButton_exec.setEnabled(True)
|
||||
def exec(self):
|
||||
self.plainTextEdit.setPlainText(ExportIDList(self.filepath))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>获取题号</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_selectfilepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>10</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>741</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>741</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>70</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>获取题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue