PyQt5
qq_26669719
这个作者很懒,什么都没留下…
展开
-
PyQt QLineEdit textchanged事件
参考https://stackoverflow.com/questions/12182133/pyqt4-combine-textchanged-and-editingfinished-for-qlineeditclass myLineEdit(QLineEdit): signal=pyqtSignal(str) def __init__(self,parent): ...原创 2018-06-05 22:54:04 · 18756 阅读 · 1 评论 -
pyqt5打开图片
from PyQt5 import QtCore, QtGui, QtWidgetsimport sysfrom PyQt5.QtGui import *from PyQt5.QtWidgets import *from PyQt5.QtCore import *class Ui_MainWindow(object): def setupUi(self, MainWindow)...原创 2018-05-29 23:54:56 · 6951 阅读 · 1 评论 -
pyqt5按钮事件打开文件
self.pushButton.clicked.connect(self.btn1_click)#设置绑定事件def btn1_click(self):filename,_=QFileDialog.getOpenFileName(QWidget(),'open',r"E:\images1")#打开文件或者如下:getOpenFileName第一个参数要求是QWidget对象#filename,_=...原创 2018-05-30 09:35:08 · 13652 阅读 · 0 评论 -
pyqt5 .ui文件转换.py,并修改为自己的窗口
用QtDesigner设计界面后,保存为.ui文件,右键用PyUIC转换为.py文件,将UI_MAINWIDOW(或UI_FORM)改为自己的窗口类名(如myWindow),将class Ui_Form(object): def setupUi(self, Form):改为:class myWin(QWidget): def __init__(self,parent=None):...原创 2018-05-30 10:38:08 · 3383 阅读 · 0 评论 -
pyqt qlistwidget改变item颜色
from PyQt5 import QtCore, QtGui, QtWidgetsfrom PyQt5.QtCore import *from PyQt5.QtWidgets import *from PyQt5.QtGui import *import sysclass Win(QWidget): def __init__(self): super(Win,...原创 2018-06-06 09:34:52 · 8537 阅读 · 0 评论 -
pyqt5 信号和槽
from PyQt5.QtWidgets import *from PyQt5.QtCore import *from PyQt5.QtGui import *import sysimport timeclass myTimer(QThread) signal=pyqtSignal()原创 2018-05-30 15:44:01 · 376 阅读 · 0 评论