[PyQt] Button Color

uahmed gleam.uahmed at gmail.com
Tue Aug 16 23:03:42 BST 2011


Hi ,

I am new in Pyqt , i am confuse on one thing whenever i make buttons the
first button color always have reddish layer . I am also attaching the code
and Screen Shot .

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('default.gif'), 'Close', widget)
close.setGeometry(10, 10, 100, 30)
close1 = QtGui.QPushButton(QtGui.QIcon('default.gif'), 'Close', widget)
close1.setGeometry(10, 50, 100, 30)

def hello():
    print 'hello everybody'

widget.connect(close, QtCore.SIGNAL('clicked()'), hello)
widget.connect(close1, QtCore.SIGNAL('clicked()'), hello)

widget.show()
sys.exit(app.exec_())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110817/3096b50e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: first-button-colour.gif
Type: image/gif
Size: 6187 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110817/3096b50e/attachment.gif>


More information about the PyQt mailing list