QPushButton with pixmap problem

Christopher Stone chris.stone at gmail.com
Sun Jun 27 03:11:18 CEST 2004


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())



More information about the Python-list mailing list