45 lines
1.6 KiB
Python
45 lines
1.6 KiB
Python
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QMainWindow
|
|
from Ui_tool_panel import Ui_MainWindow
|
|
from PySide6.QtCore import Signal, Slot
|
|
from 寻找空闲题号 import MyWindow_kxth
|
|
from database_tools_2 import *
|
|
|
|
class MyWindow(QMainWindow,Ui_MainWindow):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setupUi(self)
|
|
self.bind()
|
|
|
|
def bind(self):
|
|
self.SelectTIKUTEST()
|
|
self.pushButton_tiku.clicked.connect(self.SelectTIKU)
|
|
self.pushButton_tikutest.clicked.connect(self.SelectTIKUTEST) #以上为设置当前数据库的两个按钮
|
|
tab_kxth = MyWindow_kxth(self.database) #传递参数时有问题, 未能动态更新
|
|
for i in range(3):
|
|
self.tabWidget_luru.removeTab(0)
|
|
self.tabWidget_luru.addTab(tab_kxth,"寻找空闲题号")
|
|
def SelectTIKU(self):
|
|
self.pushButton_tiku.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
|
self.pushButton_tikutest.setStyleSheet("") #恢复原有背景, 取消粗体
|
|
SaveTextFile("tiku","临时文件/databasename.txt")
|
|
self.database = "tiku"
|
|
def SelectTIKUTEST(self):
|
|
self.pushButton_tikutest.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
|
self.pushButton_tiku.setStyleSheet("") #恢复原有背景, 取消粗体
|
|
SaveTextFile("tikutest","临时文件/databasename.txt")
|
|
self.database = "tikutest"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = QApplication([])
|
|
windows = MyWindow()
|
|
windows.show()
|
|
app.exec()
|
|
|