[PyKDE] PyQt-3.2.4 with Qt-3.0.4

Phil Thompson phil at river-bank.demon.co.uk
Fri Jun 7 12:45:00 BST 2002


katagiri wrote:

> I have installed Qt-3.0.4 and PyQt-3.2.4.
> I can't get name list of Qt.Key_xxx in PyQt-3.2.4.
> PyQt-3.0 works fine, but PyQt-3.2.4 does not work.
> Why ?
> --
> PyQt-3.0 : Qt-2.3.2
> 
> $ python
> Python 2.2 (#1, Feb 12 2002, 11:29:07) 
> [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>>from qt import *
>>>>filter(lambda x: x[:4] == 'Key_', dir(Qt))
>>>>
> ['Key_0', 'Key_1', 'Key_2', 'Key_3', 'Key_4', 'Key_5', ... ]
> 
> 
> --
> PyQt-3.2.4 : Qt-3.0.4
> $ python
> Python 2.2.1 (#3, Jun  6 2002, 14:09:40) 
> [GCC 2.95.3 20010315 (release)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>>from qt import *
>>>>filter(lambda x: x[:4] == 'Key_', dir(Qt))
>>>>
> []


In PyQt class methods are lazy, ie. they are only put into instance 
dictionaries when they are needed (ie. when they are referenced). While 
doing this isn't "normal", it greatly reduces the startup time and 
memory footprint.

In PyQt 3.1 this technique was extended to enums - which is how the Key_ 
values are implemented. The disadvantage is that what you are trying to 
do becomes impossible.

Phil




More information about the PyQt mailing list