[PyKDE] Returning real python type through "child()" function?

Hogendoorn, Rene r.hogendoorn at hitt.nl
Wed Apr 10 16:34:47 BST 2002


I want to use a validator for the (internal) QLineEdit of the QListViewItem
class during renaming,
i.e. I want to control the renaming process.
Currently, no direct APIs are exposed in Qt. The only way is to subclass
QListViewItem and to
get the QLineEdit via the child() function of the encapsulating listview
class (it is the "qt_renamebox" child).
Unfortunately, this only works in C++, since, there, you can dynamic_cast
the returned QObject.
In python, you are stuck with the virtually useless QObject.

In PyQt, the necessary information to return to real type is available. I.e.
the type of the child can be
derived from the metaobject information; so, in principle, a python object
of the proper type could be
returned.
Any thoughts about this?

Regards,
René Hogendoorn

--
HITT Holland Institute of Traffic Technology B.V.
Oude Apeldoornseweg 41-45, P.O.-Box 717, NL-7300AS, Apeldoorn.
Tel.( +31) 55 543 2594, 
Fax. (+31) 55 543 2553.  
E-mail: r.hogendoorn at hitt.nl 





More information about the PyQt mailing list