[PyKDE] Listbox returns dictionary key?

Gordon Tyler gordon at doxxx.net
Thu Aug 7 08:27:01 BST 2003


On August 7, 2003 12:13 am, Peter Clark wrote:
> 	Ah-ha! I actually tried that, but I made a mistake; on the analogy of
> "selected(int)", I tried omitting the "QString &" part. So is it only safe
> to omit "index"? The documentation has the following:
>
> void selected ( int index )
> void selected ( const QString & )
>
> Yet valid PyQt calls are:
> "selected(int)"
> "selected(const QString &)"
>
> See my confusion? (Note that my knowledge of C++ is almost zilch, so
> forgive any errors of ignorance.)

Yeah, the bit that you must omit in the signal string is the parameter name if 
it is present in the C++. So the first selected signal has an int parmeter 
called "index", but the second signal has an unnamed const QString & 
parameter. const == unmodifiable, & == reference instead of pointer - don't 
worry about it, it's just obscure C++ cruft ;) and it is automatically 
translated into an object that you can use.

As to why the one has a parameter name and the other doesn't... *shrug*

Ciao,
Gordon




More information about the PyQt mailing list