[PyKDE] className()

Boudewijn Rempt bsarempt at xs4all.nl
Thu Jul 5 21:45:08 BST 2001


I had to find out the name of a class from the instance of a class,
and I found the className() function of QObject. However, when I
tried to use it, I came across the following:

>>> from qt import *
>>> a=QPlatinumStyle()
>>> print a
<qt.QPlatinumStyle instance at 0x8308f94>
>>> print a.className()
QObject
>>> print isinstance(a, QPlatinumStyle)
1

And I was much surprised. Obviously, sip knows what this is - but
the className() function doesn't. Is this merely a bug in sip, or
do I have to parse the repr output?

(If you want to know what I needed this for - wait till Friday,
when I hope the new chapter on configuration files goes up...)

Boudewijn





More information about the PyQt mailing list