470,841 Members | 1,063 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,841 developers. It's quick & easy.

QPushButton with pixmap problem

The following short program written in PyQt does not display the q2
push button, does anyone know what I'm doing wrong?

#!/usr/bin/env python

import sys
from qt import *

class myQVBox(QVBox):
def __init__(self):
QVBox.__init__(self)
q1 = QPushButton("Quit 1", self)
q2 = QPushButton(QIconSet(QPixmap('mypix.png')),
"Quit 2", self)

app = QApplication(sys.argv)
main = myQVBox()

app.setMainWidget(main)
main.show()

sys.exit(app.exec_loop())
Jul 18 '05 #1
1 3051
On Sunday 27 June 2004 2:11 am, Christopher Stone wrote:
The following short program written in PyQt does not display the q2
push button, does anyone know what I'm doing wrong?

#!/usr/bin/env python

import sys
from qt import *

class myQVBox(QVBox):
def __init__(self):
QVBox.__init__(self)
q1 = QPushButton("Quit 1", self)
q2 = QPushButton(QIconSet(QPixmap('mypix.png')),
"Quit 2", self)

app = QApplication(sys.argv)
main = myQVBox()

app.setMainWidget(main)
main.show()

sys.exit(app.exec_loop())


It's a bug in PyQt. It will be fixed in tonight's snapshot.

The workaround is to set the pixmap separately...

q2 = QPushButton("Quit 2", self)
q2.setIconSet(QIconSet(QPixmap('mypix.png')))

Phil

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Kostatus | last post: by
117 posts views Thread by Peter Olcott | last post: by
18 posts views Thread by Ian Stanley | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
1 post views Thread by Thomas Girod | last post: by
1 post views Thread by luca72 | last post: by
reply views Thread by jubi | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.