[PyKDE] Strange behavior:

Greg Fortune lists at gregfortune.com
Wed Jul 7 04:17:01 BST 2004


Cool... it's like hide and seek :)

How about this?  Maybe in site.py?

import qt
qt.QPushButton = qt.QLabel

#or maybe

from qt import *
QPushButton = QLabel

Did I win anything ;o)

You might try running the following code by placing it where your 
FlashingLabel class is defined... Make sure to leave any other code that 
might be in the file.  If any of the address/classes don't make sense, you'll 
at least have something to investigate.

import qt

def dump(obj):
  print "type: %s, __class__: %s, obj: %s" % (type(obj), obj.__class__, obj)

#check the types and memory addresses
for x in [qt.QLabel, qt.QPushButton, QLabel, QPushButton]:
	dump(obj)

class FlashingLabel(QLabel):
  def __init__(self, text, parent):
    dump(self)
    dump(QPushButton)
    QPushButton.__init__(self, text, parent)



You might also make sure you don't have multiple versions of PyQt/sip laying 
around.


Good luck,

Greg Fortune
Fortune Solutions

On Tuesday 06 July 2004 10:35 pm, Maurizio Colucci wrote:
> This code works perfectly on my machine (suse 9.1) but not with other
> peoples':
>
>
> class FlashingLabel(QLabel):
>         def __init__(self, text, parent):
>                 QPushButton.__init__(self, text, parent) #obviously wrong.
>
> How can it work? :-)
> I have PyQt 3.12-1.
>
> Thanks
>
> Maurizio
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde




More information about the PyQt mailing list