[PyKDE] overloading events with qt designer and pyqt

Sebastian Kügler sebas at kde.nl
Tue Jun 28 20:55:30 BST 2005


On Tuesday 28 June 2005 20:50, Frank Stüss wrote:
> > I'm not sure if that's really what you want, but if you'd like to
> > use qt-designer and hand-coded additions at the same time, you can
> > create your UI / widgets using qt-designer and then subclassing
> > that UI in another file and overload the (paint)event. That way you
> > can still change the UI without having to re-merge your changes
> > everytime you recompile the .ui files.
>
> Thanks. Got it. But what if i don't want to overload the overall
> paintEvent of the UI but only the one of a part of it, eg. a QFrame
> or a QHbox? Shure I would subclass QFrame and overload the event but
> how can I put it into the 'designed' code, since my UI still uses
> QFrame and not the subclass of it.
>
> I like to do some simple drawLines on a QFrame not using any
> extension packages, only what is shipped with QT and pyqt.

That would involve adding custom widgets to qt-designer, I'm not sure if 
this is supported (yet?).

Of course you could use a more hacky solution, like replacing the QFrame 
in your subclass, but that's ugly.

> Thanks again for any help.
-- 
sebas

  http://vizZzion.org   |   GPG Key ID: 9119 0EF9 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Do you know the difference between education and experience?  Education 
is what you get when you read the fine print; experience is what you 
get when you don't. - Pete Seeger

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050628/9ab9f9b0/attachment.bin


More information about the PyQt mailing list