1 Star 0 Fork 4

VegetableAndChicken/demo_py_opencv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gui_logic.py 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
lijian 提交于 2019-07-04 10:52 . first
import sys
from PyQt5.QtWidgets import QApplication,QMainWindow,QFileDialog,QToolTip
from PyQt5.QtGui import QFont
from gui import *
class MyMainWindow(QMainWindow,Ui_MainWindow):
def __init__(self):
super().__init__()
QToolTip.setFont(QFont("SansSerif",10))
self.setToolTip("这是一个<b>测试提示</b>")
self.setupUi(self)
self.fileCloseAction.triggered.connect(self.close)
self.fileOpenAction.triggered.connect(self.openMsg)
self.toolButton.clicked.connect(self.openFile)
self.toolButton_2.clicked.connect(self.openDirectory)
def openMsg(self):
file,ok=QFileDialog.getOpenFileName(self,"打开","./","All File (*);;Text Files (*.txt)")
self.statusbar.showMessage(file,2000)
def openFile(self):
self.file, ok = QFileDialog.getOpenFileName(self, "保存文件路径", "./", "All File (*);;Text Files (*.txt)")
self.lineEdit.setText(self.file)
def openDirectory(self):
self.file= QFileDialog.getExistingDirectory(self,"保存文件夹路径", "./")
self.lineEdit_2.setText(self.file)
if __name__=="__main__":
app=QApplication(sys.argv)
myWin= MyMainWindow()
myWin.show()
sys.exit(app.exec_())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/vegetableandchicken/demo_py_opencv.git
git@gitee.com:vegetableandchicken/demo_py_opencv.git
vegetableandchicken
demo_py_opencv
demo_py_opencv
master

搜索帮助