import sys
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.setGeometry(200, 100, 400, 300)
widget.setWindowTitle('PyQt Application')
close = QtGui.QPushButton(QtGui.QIcon('lucia.png'), 'Close', widget)
close.setGeometry(10, 10, 100, 30)
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.setGeometry(200, 100, 400, 300)
widget.setWindowTitle('PyQt Application')
close = QtGui.QPushButton(QtGui.QIcon('lucia.png'), 'Close', widget)
close.setGeometry(10, 10, 100, 30)
def hello():
print 'hello everybody' widget.connect(close, QtCore.SIGNAL('clicked()'), hello)
widget.show()
sys.exit(app.exec_())
widget.show()
sys.exit(app.exec_())
hi
ReplyDeleteits a good example , can you please tell me how to increase the size of icon image it looks so much little on button