[PyKDE] AttributeError in PyQt on WinXP

Patrick Stinson patrickkidd.lists at gmail.com
Thu Jun 1 16:59:29 BST 2006


def print_attrs(o):
    for i in o.__dict__.keys():
        print i
print_attrs(QApplication([]))

On 5/31/06, Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> On Thursday 01 June 2006 12:38 am, Rightful King wrote:
> > Hey all,
> >
> > Here is the code:
> >
> > import sys
> > from Qt import *
> >
> > a = QApplication([])
> >
> > # Our function to call when the button is clicked
> > def sayHello():
> >     print "Hello, World!"
> >
> > # Instantiate the button
> > hellobutton = QPushButton("Say 'Hello world!'",None)
> >
> > # And connect the action "sayHello" to the event "button has been clicked"
> > a.connect(hellobutton, SIGNAL("clicked()"), sayHello)
> >
> > # The rest is known already...
> > a.set_main_widget(hellobutton)
> > hellobutton.show()
> > a.exec_loop()
> >
> >
> > I get the following message: AttributeError: set_main_widget
>
> setMainWidget() is PyQt3. There is no equivalent in PyQt4.
>
> > When I comment out that line, I get the same message about exec_loop.
> > What's up?
>
> exec_loop() is PyQt3. The PyQt4 equivalent is exec_().
>
> Phil
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>


-- 
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/




More information about the PyQt mailing list