[PyKDE] Problem: drawPushButton
    Grzegorz Zegartowski 
    greg at itam.zabrze.pl
       
    Tue Jul 10 12:54:36 BST 2001
    
    
  
Hello
I wrote a simple program, and it doesn't work:
#############################################################
File "test.py", line 12, in drawButton
    self.style().drawPushButtonLabel(self, painter) #!error
AttributeError: drawPushButtonLabel
#############################################################
Any ideas?
################################################################################# 
##
import sys
from qt import *
class MyPushButton(QPushButton):
    """"""
    def __init__(self, parent=None, name=None):
        QPushButton.__init__(self, parent, name)
   
    def drawButton(self, painter):
        self.style().drawPushButtonLabel(self, painter) #!error
        self.drawButtonLabel(painter)
def main ():
    """main"""
    app = QApplication(sys.argv)
    mybtn = MyPushButton()
    mybtn.setText("test")
    app.setMainWidget(mybtn)
    mybtn.show()
    app.exec_loop()
if __name__ == '__main__':
    main() 
#########################################################################################
Greg
    
    
More information about the PyQt
mailing list