1 Star 0 Fork 38

nicholas40417/审计工具箱 Audbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main_Audbox3.py 3.55 KB
一键复制 编辑 原始数据 按行查看 历史
wwwwwc 提交于 2021-01-18 18:03 . 上传源码
# -*- coding:UTF-8 -*-
import datetime
import os
import sys
import time
from PyQt5.QtWidgets import QApplication, QMainWindow
import Audbox_rc
from Ui_Audbox import *
from Ui_dialog import *
from module import Express_Tracking_6_FSF as fsf
from module import testpyqt
# 单继承主窗体
class MyWindows(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.ui = Ui_mainWindow()
self.ui.setupUi(self)
self.but_connect()
# sys.stdout = EmittingStr(textWritten=self.outputWritten)
# sys.stderr = EmittingStr(textWritten=self.outputWritten)
def now_time(self):
Now_Time = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d_%H:%M:%S')
return Now_Time
def paintEvent(self, e): # 窗口重绘事件,用于自动调整textBrowser
widget_w = self.ui.centralwidget.width()-20
widget_h = self.ui.centralwidget.height()-90
widget_h_margin = self.ui.textBrowser.y()
top_margin = self.ui.textBrowser.x()
self.ui.textBrowser.setGeometry(QtCore.QRect(top_margin, widget_h_margin, widget_w, widget_h))
def show_gxh(self): # 关于软件
self.sender = '显示公众号'
dialog.resize(438, 201)
dialog.ui1.label.setGeometry(QtCore.QRect(0, 0, 441, 201))
dialog.ui1.label.setPixmap(QtGui.QPixmap(":/logo/icons/12_gongzhonghao.png"))
dialog.show()
def show_kjz(self): # 空间站
dialog.resize(300, 60)
dialog.ui1.label.setGeometry(QtCore.QRect(0, 0, 300, 60))
dialog.setWindowTitle('One Piece @效率视界')
url = 'http://xiaolv.ys168.com/'
text = '效率视界的空间站:<a href="{}">{}</a>'.format(url,url)
dialog.ui1.label.setText(text)
dialog.ui1.label.setOpenExternalLinks(True)
dialog.show()
def show_chat(self): # 群聊
dialog.resize(400, 60)
dialog.ui1.label.setGeometry(QtCore.QRect(0, 0, 400, 60))
dialog.setWindowTitle('交流提问 @效率视界')
url = 'https://mp.weixin.qq.com/s/krk_vWtvCZDLepb_KxeGdg'
text = '效率社群:<a href="{}">{}</a>'.format(url,url)
dialog.ui1.label.setText(text)
dialog.ui1.label.setOpenExternalLinks(True)
dialog.show()
def but_connect(self): # 按钮绑定函数
self.ui.pushButton.clicked.connect(self.execute)
self.ui.action.triggered.connect(self.show_gxh)
self.ui.action_2.triggered.connect(self.show_kjz)
self.ui.action_3.triggered.connect(self.show_chat)
def execute(self):
self.mythread = MyThread() # 实例化自己建立的任务线程类
self.mythread.start()# 启动线程
self.mythread.trigger.connect(self.printf)# 线程自定义信号连接的槽函数
def printf(self,str):
self.ui.textBrowser.append(str)
QtWidgets.QApplication.processEvents()
class MyThread(QtCore.QThread):
trigger = QtCore.pyqtSignal(str)
def __init__(self):
super(MyThread, self).__init__()
self.working = True
def run(self):
x = testpyqt.test() # 把这个函数放入子线程
# fsf.Express()
self.trigger.emit(x.a)
# 单继承子窗体
class dialog(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.ui1 = Ui_dialog()
self.ui1.setupUi(self)
if __name__ == '__main__':
app = QApplication(sys.argv)
#实例化主窗体
mainWindow = MyWindows()
#实例化子窗体
dialog=dialog()
mainWindow.show()
sys.exit(app.exec_())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/nicholas40417/audbox.git
git@gitee.com:nicholas40417/audbox.git
nicholas40417
audbox
审计工具箱 Audbox
master

搜索帮助