标签:
# -*- coding: cp936 -*-
import sys
from PyQt4 import QtGui,QtCore
class QuitButton(QtGui.QWidget):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self,parent)
self.setGeometry(300,300,250,150)
self.setWindowTitle(u‘关闭的呀?‘)
quit=QtGui.QPushButton(‘close()‘,self)
quit.setGeometry(10,10,60,35)
self.connect(quit,QtCore.SIGNAL(‘clicked‘),QtGui.qApp,
QtCore.SLOT(‘quit()‘))
app=QtGui.QApplication(sys.argv)
qb=QuitButton()
qb.show()
sys.exit(app.exec_())
如图:
标签:
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4156334.html