标签:etl pyqt qt4 size 技术 ttext qlabel log exe
import sys from PyQt4 import QtCore, QtGui class myWidget(QtGui.QWidget): def __init__(self): super(myWidget, self).__init__() self.setWindowTitle("test") self.resize(300, 200) self.lab = QtGui.QLabel("label") self.btn = QtGui.QPushButton("button") hbox = QtGui.QHBoxLayout() hbox.addWidget(self.lab) hbox.addWidget(self.btn) self.setLayout(hbox) self.connect(self.btn, QtCore.SIGNAL(‘clicked()‘), self, QtCore.SLOT(‘OnClick()‘)) @QtCore.pyqtSlot() def OnClick(self): self.lab.setText("sdfasdf") app = QtGui.QApplication(sys.argv) wi = myWidget() wi.show() app.exec_()
标签:etl pyqt qt4 size 技术 ttext qlabel log exe
原文地址:http://www.cnblogs.com/tiandsp/p/7580563.html