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

Phil Thompson phil at river-bank.demon.co.uk
Sat Apr 13 12:38:50 BST 2002


"Hogendoorn, Rene" wrote:
> 
> 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?

The current CVS version should do what you want. The support was added
to help factory classes and plugins.

Phil





More information about the PyQt mailing list