qt面板制作推进

This commit is contained in:
weiye.wang 2024-03-01 22:14:24 +08:00
parent 2770c4fb34
commit df9a6ad72e
3 changed files with 287 additions and 67 deletions

View File

@ -1,8 +1,6 @@
from PySide6.QtWidgets import QMainWindow, QApplication, QFileDialog, QWidget
from Ui_Qt面板 import *
from Ui_寻找空闲题号 import *
import os
from database_tools import *
from subprocess import call
class MyWindow(QMainWindow,Ui_MainWindow):
@ -12,34 +10,12 @@ class MyWindow(QMainWindow,Ui_MainWindow):
self.bind()
def bind(self):
self.subwindow = kxthWindow()
self.action_kxth.triggered.connect(lambda: self.subwindow.show())
self.action_kxth.triggered.connect(lambda: call(["python", "系列讲义生成.py"]))
self.action_xtbd.triggered.connect(lambda: call(["python", "新题比对.py"]))
class kxthWindow(QWidget,Ui_Form):
def __init__(self):
super().__init__()
self.setupUi(self)
self.bind()
self.lineEdit_FilePath.setText(os.path.join(os.path.dirname(os.getcwd()),"题库0.3","Problems.json"))
self.ShowAvailable()
def bind(self):
self.pushButton_SelectFilepath.clicked.connect(self.getFilePathandShow)
def ShowAvailable(self):
self.jsonpath = self.lineEdit_FilePath.text()
pro_dict = load_dict(self.jsonpath)
self.label_Available.setText(spareIDs(pro_dict))
def getFilePathandShow(self):
pathlist = QFileDialog.getOpenFileName(self,"选择文件",".","json文件(*.json);;所有文件(*)")
self.lineEdit_FilePath.setText(pathlist[0])
self.ShowAvailable()

View File

@ -7,11 +7,11 @@
<x>0</x>
<y>0</y>
<width>426</width>
<height>366</height>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>题库工具面板(PyQt)-20240301</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
@ -23,43 +23,77 @@
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<widget class="QMenu" name="menu_luru">
<property name="title">
<string>录入</string>
</property>
<addaction name="action_kxth"/>
<addaction name="separator"/>
<addaction name="action_xtbd"/>
<addaction name="action_plsl"/>
<addaction name="separator"/>
<addaction name="action_tjgl"/>
</widget>
<widget class="QMenu" name="menu_2">
<widget class="QMenu" name="menu_weihu">
<property name="title">
<string>维护</string>
</property>
<addaction name="action_tjzd"/>
<addaction name="separator"/>
<addaction name="action_bjtm"/>
<addaction name="separator"/>
<addaction name="action_xxdr"/>
<addaction name="action_sddr"/>
<addaction name="action_tkdr"/>
<addaction name="separator"/>
<addaction name="action_dygg"/>
<addaction name="separator"/>
<addaction name="action_tqda"/>
<addaction name="separator"/>
<addaction name="action_hbsy"/>
<addaction name="separator"/>
<addaction name="action_tjjc"/>
</widget>
<widget class="QMenu" name="menu_3">
<widget class="QMenu" name="menu_shiyong">
<property name="title">
<string>使用</string>
</property>
<addaction name="action_sxth"/>
<addaction name="separator"/>
<addaction name="action_xtby"/>
<addaction name="separator"/>
<addaction name="action_sctp"/>
<addaction name="separator"/>
<addaction name="action_hqth"/>
</widget>
<widget class="QMenu" name="menu_4">
<widget class="QMenu" name="menu_beikezu">
<property name="title">
<string>备课组</string>
</property>
<addaction name="action_jglr"/>
<addaction name="action_dtdy"/>
<addaction name="separator"/>
<addaction name="action_jysc"/>
</widget>
<widget class="QMenu" name="menuLaTeX">
<widget class="QMenu" name="menu_latex">
<property name="title">
<string>LaTeX代码相关</string>
</property>
<addaction name="action_mtpx"/>
<addaction name="action_dqsz"/>
<addaction name="action_dxtk"/>
</widget>
<widget class="QMenu" name="menu_5">
<widget class="QMenu" name="menu_exit">
<property name="title">
<string>退出</string>
</property>
</widget>
<addaction name="menu"/>
<addaction name="menu_2"/>
<addaction name="menu_3"/>
<addaction name="menu_4"/>
<addaction name="menuLaTeX"/>
<addaction name="menu_5"/>
<addaction name="menu_luru"/>
<addaction name="menu_weihu"/>
<addaction name="menu_shiyong"/>
<addaction name="menu_beikezu"/>
<addaction name="menu_latex"/>
<addaction name="menu_exit"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_kxth">
@ -67,6 +101,116 @@
<string>寻找空闲题号</string>
</property>
</action>
<action name="action_xtbd">
<property name="text">
<string>新题比对</string>
</property>
</action>
<action name="action_plsl">
<property name="text">
<string>批量收录新题</string>
</property>
</action>
<action name="action_tjgl">
<property name="text">
<string>添加关联题目</string>
</property>
</action>
<action name="action_tjzd">
<property name="text">
<string>批量添加字段数据</string>
</property>
</action>
<action name="action_bjtm">
<property name="text">
<string>编辑题目</string>
</property>
</action>
<action name="action_xxdr">
<property name="text">
<string>小闲使用记录导入</string>
</property>
</action>
<action name="action_sddr">
<property name="text">
<string>手动使用记录导入</string>
</property>
</action>
<action name="action_tkdr">
<property name="text">
<string>统考使用记录导入</string>
</property>
</action>
<action name="action_hbsy">
<property name="text">
<string>合并使用记录并排序</string>
</property>
</action>
<action name="action_dygg">
<property name="text">
<string>单元挂钩</string>
</property>
</action>
<action name="action_tqda">
<property name="text">
<string>提取答案</string>
</property>
</action>
<action name="action_sxth">
<property name="text">
<string>关键字筛选题号</string>
</property>
</action>
<action name="action_xtby">
<property name="text">
<string>选题编译</string>
</property>
</action>
<action name="action_sctp">
<property name="text">
<string>题号生成图片</string>
</property>
</action>
<action name="action_tjjc">
<property name="text">
<string>添加基础知识梳理</string>
</property>
</action>
<action name="action_jglr">
<property name="text">
<string>讲义结构编号录入</string>
</property>
</action>
<action name="action_dtdy">
<property name="text">
<string>录入答题纸对应信息</string>
</property>
</action>
<action name="action_jysc">
<property name="text">
<string>系列讲义生成</string>
</property>
</action>
<action name="action_hqth">
<property name="text">
<string>获取题号</string>
</property>
</action>
<action name="action_mtpx">
<property name="text">
<string>mathpix预处理</string>
</property>
</action>
<action name="action_dqsz">
<property name="text">
<string>括号数字变为带圈数字</string>
</property>
</action>
<action name="action_dxtk">
<property name="text">
<string>多选转填空</string>
</property>
</action>
</widget>
<resources/>
<connections/>

View File

@ -23,39 +23,117 @@ class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(426, 366)
MainWindow.resize(426, 330)
self.action_kxth = QAction(MainWindow)
self.action_kxth.setObjectName(u"action_kxth")
self.action_xtbd = QAction(MainWindow)
self.action_xtbd.setObjectName(u"action_xtbd")
self.action_plsl = QAction(MainWindow)
self.action_plsl.setObjectName(u"action_plsl")
self.action_tjgl = QAction(MainWindow)
self.action_tjgl.setObjectName(u"action_tjgl")
self.action_tjzd = QAction(MainWindow)
self.action_tjzd.setObjectName(u"action_tjzd")
self.action_bjtm = QAction(MainWindow)
self.action_bjtm.setObjectName(u"action_bjtm")
self.action_xxdr = QAction(MainWindow)
self.action_xxdr.setObjectName(u"action_xxdr")
self.action_sddr = QAction(MainWindow)
self.action_sddr.setObjectName(u"action_sddr")
self.action_tkdr = QAction(MainWindow)
self.action_tkdr.setObjectName(u"action_tkdr")
self.action_hbsy = QAction(MainWindow)
self.action_hbsy.setObjectName(u"action_hbsy")
self.action_dygg = QAction(MainWindow)
self.action_dygg.setObjectName(u"action_dygg")
self.action_tqda = QAction(MainWindow)
self.action_tqda.setObjectName(u"action_tqda")
self.action_sxth = QAction(MainWindow)
self.action_sxth.setObjectName(u"action_sxth")
self.action_xtby = QAction(MainWindow)
self.action_xtby.setObjectName(u"action_xtby")
self.action_sctp = QAction(MainWindow)
self.action_sctp.setObjectName(u"action_sctp")
self.action_tjjc = QAction(MainWindow)
self.action_tjjc.setObjectName(u"action_tjjc")
self.action_jglr = QAction(MainWindow)
self.action_jglr.setObjectName(u"action_jglr")
self.action_dtdy = QAction(MainWindow)
self.action_dtdy.setObjectName(u"action_dtdy")
self.action_jysc = QAction(MainWindow)
self.action_jysc.setObjectName(u"action_jysc")
self.action_hqth = QAction(MainWindow)
self.action_hqth.setObjectName(u"action_hqth")
self.action_mtpx = QAction(MainWindow)
self.action_mtpx.setObjectName(u"action_mtpx")
self.action_dqsz = QAction(MainWindow)
self.action_dqsz.setObjectName(u"action_dqsz")
self.action_dxtk = QAction(MainWindow)
self.action_dxtk.setObjectName(u"action_dxtk")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QMenuBar(MainWindow)
self.menubar.setObjectName(u"menubar")
self.menubar.setGeometry(QRect(0, 0, 426, 22))
self.menu = QMenu(self.menubar)
self.menu.setObjectName(u"menu")
self.menu_2 = QMenu(self.menubar)
self.menu_2.setObjectName(u"menu_2")
self.menu_3 = QMenu(self.menubar)
self.menu_3.setObjectName(u"menu_3")
self.menu_4 = QMenu(self.menubar)
self.menu_4.setObjectName(u"menu_4")
self.menuLaTeX = QMenu(self.menubar)
self.menuLaTeX.setObjectName(u"menuLaTeX")
self.menu_5 = QMenu(self.menubar)
self.menu_5.setObjectName(u"menu_5")
self.menu_luru = QMenu(self.menubar)
self.menu_luru.setObjectName(u"menu_luru")
self.menu_weihu = QMenu(self.menubar)
self.menu_weihu.setObjectName(u"menu_weihu")
self.menu_shiyong = QMenu(self.menubar)
self.menu_shiyong.setObjectName(u"menu_shiyong")
self.menu_beikezu = QMenu(self.menubar)
self.menu_beikezu.setObjectName(u"menu_beikezu")
self.menu_latex = QMenu(self.menubar)
self.menu_latex.setObjectName(u"menu_latex")
self.menu_exit = QMenu(self.menubar)
self.menu_exit.setObjectName(u"menu_exit")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QStatusBar(MainWindow)
self.statusbar.setObjectName(u"statusbar")
MainWindow.setStatusBar(self.statusbar)
self.menubar.addAction(self.menu.menuAction())
self.menubar.addAction(self.menu_2.menuAction())
self.menubar.addAction(self.menu_3.menuAction())
self.menubar.addAction(self.menu_4.menuAction())
self.menubar.addAction(self.menuLaTeX.menuAction())
self.menubar.addAction(self.menu_5.menuAction())
self.menu.addAction(self.action_kxth)
self.menubar.addAction(self.menu_luru.menuAction())
self.menubar.addAction(self.menu_weihu.menuAction())
self.menubar.addAction(self.menu_shiyong.menuAction())
self.menubar.addAction(self.menu_beikezu.menuAction())
self.menubar.addAction(self.menu_latex.menuAction())
self.menubar.addAction(self.menu_exit.menuAction())
self.menu_luru.addAction(self.action_kxth)
self.menu_luru.addSeparator()
self.menu_luru.addAction(self.action_xtbd)
self.menu_luru.addAction(self.action_plsl)
self.menu_luru.addSeparator()
self.menu_luru.addAction(self.action_tjgl)
self.menu_weihu.addAction(self.action_tjzd)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_bjtm)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_xxdr)
self.menu_weihu.addAction(self.action_sddr)
self.menu_weihu.addAction(self.action_tkdr)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_dygg)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_tqda)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_hbsy)
self.menu_weihu.addSeparator()
self.menu_weihu.addAction(self.action_tjjc)
self.menu_shiyong.addAction(self.action_sxth)
self.menu_shiyong.addSeparator()
self.menu_shiyong.addAction(self.action_xtby)
self.menu_shiyong.addSeparator()
self.menu_shiyong.addAction(self.action_sctp)
self.menu_shiyong.addSeparator()
self.menu_shiyong.addAction(self.action_hqth)
self.menu_beikezu.addAction(self.action_jglr)
self.menu_beikezu.addAction(self.action_dtdy)
self.menu_beikezu.addSeparator()
self.menu_beikezu.addAction(self.action_jysc)
self.menu_latex.addAction(self.action_mtpx)
self.menu_latex.addAction(self.action_dqsz)
self.menu_latex.addAction(self.action_dxtk)
self.retranslateUi(MainWindow)
@ -65,11 +143,33 @@ class Ui_MainWindow(object):
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
self.action_kxth.setText(QCoreApplication.translate("MainWindow", u"\u5bfb\u627e\u7a7a\u95f2\u9898\u53f7", None))
self.menu.setTitle(QCoreApplication.translate("MainWindow", u"\u5f55\u5165", None))
self.menu_2.setTitle(QCoreApplication.translate("MainWindow", u"\u7ef4\u62a4", None))
self.menu_3.setTitle(QCoreApplication.translate("MainWindow", u"\u4f7f\u7528", None))
self.menu_4.setTitle(QCoreApplication.translate("MainWindow", u"\u5907\u8bfe\u7ec4", None))
self.menuLaTeX.setTitle(QCoreApplication.translate("MainWindow", u"LaTeX\u4ee3\u7801\u76f8\u5173", None))
self.menu_5.setTitle(QCoreApplication.translate("MainWindow", u"\u9000\u51fa", None))
self.action_xtbd.setText(QCoreApplication.translate("MainWindow", u"\u65b0\u9898\u6bd4\u5bf9", None))
self.action_plsl.setText(QCoreApplication.translate("MainWindow", u"\u6279\u91cf\u6536\u5f55\u65b0\u9898", None))
self.action_tjgl.setText(QCoreApplication.translate("MainWindow", u"\u6dfb\u52a0\u5173\u8054\u9898\u76ee", None))
self.action_tjzd.setText(QCoreApplication.translate("MainWindow", u"\u6279\u91cf\u6dfb\u52a0\u5b57\u6bb5\u6570\u636e", None))
self.action_bjtm.setText(QCoreApplication.translate("MainWindow", u"\u7f16\u8f91\u9898\u76ee", None))
self.action_xxdr.setText(QCoreApplication.translate("MainWindow", u"\u5c0f\u95f2\u4f7f\u7528\u8bb0\u5f55\u5bfc\u5165", None))
self.action_sddr.setText(QCoreApplication.translate("MainWindow", u"\u624b\u52a8\u4f7f\u7528\u8bb0\u5f55\u5bfc\u5165", None))
self.action_tkdr.setText(QCoreApplication.translate("MainWindow", u"\u7edf\u8003\u4f7f\u7528\u8bb0\u5f55\u5bfc\u5165", None))
self.action_hbsy.setText(QCoreApplication.translate("MainWindow", u"\u5408\u5e76\u4f7f\u7528\u8bb0\u5f55\u5e76\u6392\u5e8f", None))
self.action_dygg.setText(QCoreApplication.translate("MainWindow", u"\u5355\u5143\u6302\u94a9", None))
self.action_tqda.setText(QCoreApplication.translate("MainWindow", u"\u63d0\u53d6\u7b54\u6848", None))
self.action_sxth.setText(QCoreApplication.translate("MainWindow", u"\u5173\u952e\u5b57\u7b5b\u9009\u9898\u53f7", None))
self.action_xtby.setText(QCoreApplication.translate("MainWindow", u"\u9009\u9898\u7f16\u8bd1", None))
self.action_sctp.setText(QCoreApplication.translate("MainWindow", u"\u9898\u53f7\u751f\u6210\u56fe\u7247", None))
self.action_tjjc.setText(QCoreApplication.translate("MainWindow", u"\u6dfb\u52a0\u57fa\u7840\u77e5\u8bc6\u68b3\u7406", None))
self.action_jglr.setText(QCoreApplication.translate("MainWindow", u"\u8bb2\u4e49\u7ed3\u6784\u7f16\u53f7\u5f55\u5165", None))
self.action_dtdy.setText(QCoreApplication.translate("MainWindow", u"\u5f55\u5165\u7b54\u9898\u7eb8\u5bf9\u5e94\u4fe1\u606f", None))
self.action_jysc.setText(QCoreApplication.translate("MainWindow", u"\u7cfb\u5217\u8bb2\u4e49\u751f\u6210", None))
self.action_hqth.setText(QCoreApplication.translate("MainWindow", u"\u83b7\u53d6\u9898\u53f7", None))
self.action_mtpx.setText(QCoreApplication.translate("MainWindow", u"mathpix\u9884\u5904\u7406", None))
self.action_dqsz.setText(QCoreApplication.translate("MainWindow", u"\u62ec\u53f7\u6570\u5b57\u53d8\u4e3a\u5e26\u5708\u6570\u5b57", None))
self.action_dxtk.setText(QCoreApplication.translate("MainWindow", u"\u591a\u9009\u8f6c\u586b\u7a7a", None))
self.menu_luru.setTitle(QCoreApplication.translate("MainWindow", u"\u5f55\u5165", None))
self.menu_weihu.setTitle(QCoreApplication.translate("MainWindow", u"\u7ef4\u62a4", None))
self.menu_shiyong.setTitle(QCoreApplication.translate("MainWindow", u"\u4f7f\u7528", None))
self.menu_beikezu.setTitle(QCoreApplication.translate("MainWindow", u"\u5907\u8bfe\u7ec4", None))
self.menu_latex.setTitle(QCoreApplication.translate("MainWindow", u"LaTeX\u4ee3\u7801\u76f8\u5173", None))
self.menu_exit.setTitle(QCoreApplication.translate("MainWindow", u"\u9000\u51fa", None))
# retranslateUi