On Tuesday 05 May 2009 04:20:32 you wrote:
> I suppose it is not really "translating". I'll elaborate a little more.
> Say you create a signal/slot for a button. So the button fires a
> "clicked" signal and say there's a UI list that clears the item (slot)
> on the list. You can do this using the Qt Designer and all the code
> would be translated to Python using pyuic. But say the slot isn't
> clearing the list, but to add an item to the list. You'd then need to
> create a custom "slot" (say it is called addEntry), and you'd write some
> C++ code for the addEntry slot function to add items to the list. But
> pyuic wouldn't convert that and you'd have to write some python method
> for addEntry.

I'm not sure I completely follow, but you can write slots in pure python, in 
fact, PyQt treats all class methods of QObject subclasses as slots (just don't 
forget to call the QObject constructor from your own !). There are some 
caveats which stem from C++ polymorphism and Qt metaobjects, but those are 
solvable with a few decorators.

You might want to take a look at 
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#signal-
and-slot-support

(actually, the whole page is a good read to familiarize yourself with the 
python aspect of Qt)

> I hope I am getting the right idea here (after reading and trying out a
> few tutorials), and what's pyrrc? I don't think I've heard it before...

pyrrc compiles qrc (resource) files, usually containing bundled icons, images, 
etc.

_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to