[PyKDE] Recent convert's comments
phil at river-bank.demon.co.uk
Tue Jan 9 12:46:20 GMT 2001
Markus Stenberg wrote:
> I first tried to get started with 2.2, then hoping for fix to (2) moved to
> 2.3pre1.. it didn't address the issue either, so here we go, my comments
> about how PyQt works for me :)
>  First of all, some (*) classes seem to be missing some methods. No big
> deal, just required some SIP file twiddling to get the pyuic-converted UIs
I found 9 that were missing from QSlider and they've now been added to
the CVS version. Let me know if there are any more.
>  PyQt (and SIP'd stuff in general) explodes _mysteriously_ if you try
> to do multiple inheritance. I understand the reasons behind this, but at
> least _I_ couldn't find any reference to it in PyQt documentation, and
> only way I realized the limitation was by browsing SIP-generated source
It's been on the TODO list for ages to detect when a programmer tries to
do this. I've added a statement to the docs saying not to do it.
> I wish there was way to support it as well, but guess it's possible to
> live without.. (although life's much more difficult - f.ex when
> implementing custom QSlider-type widget, I wished I could've inherited
> both QWidget and QRangeControl..)
It's impossible to support. You'd have to create a new C++ class (and
the binding to it) dynamically.
>  It works like charm! :-) I was pleasantly surprised how easy it was to
> get started with PyQt once the two beforementioned hurdles were taken care
> of. It took me only few hours to write GravityWars-clone.. (roughly 1k
> lines of experimental code to get used to PyQt feel)
> (http://www.iki.fi/fingon/trickshot?.gif [? == ],
> http://www.iki.fi/fingon/gw.tar.gz, ms.tar.gz)
> It seems to be _much_ more fun than vanilla C++ Qt, and the speed is
> sufficient (although not neccessarily blazingly fast, but that's Python to
> you). Keep up the good work! ;-)
> -Markus Stenberg
> How is the exception handling done? I noted that my application did not
> explode totally from exceptions, but instead it seems that each event?
> performs it's own exception handling, and then resumes event loop on
I just use the standard Python exception mechanism. Once you enter the
Qt event loop it then executes bits of Python to respond to events.
Those bits may raise an exception (and are displayed as normal) but the
Qt event loop has no idea they are happening.
More information about the PyQt