[PyQt] Custom Widget

Hans-Peter Jansen hpj at urpla.net
Wed Jan 26 10:01:05 GMT 2011


On Wednesday 26 January 2011, 04:33:50 Fernando Cosso wrote:
> Thanks Pete
>
> I dont know much of C++ so I guess I will not be able to re implement
> it Python.

It's dead easy. Really. Just replace "->" with ".", combine header and 
source into one class, combine declaration and code into single python 
methods, add the privates as instance attributes to __init__ 
(preferably with a leading _), and remove everything else that looks 
like C++. 

Come back, when done and it doesn't work. 

I'm too busy with payed contracts to do that myself at the moment.

Pete

> It's a shame Qt doesnt have buttons with rich text. It is impossible
> to put Greek letters, subscripts, etc.

Hmm, greek letters aren't simple unicode characters?!?

Pete

> Best Regards
>
> On 25 January 2011 20:03, Hans-Peter Jansen <hpj at urpla.net> wrote:
> > On Wednesday 26 January 2011, 01:35:07 Fernando Cosso wrote:
> > > Hi All
> > >
> > > I would like to use this custom widget
> > > http://www.qtcentre.org/wiki/index.php?title=Buttons_with_richt_t
> > >ext_ %28multiple_colors%29in the Designer,
> > >
> > > but I don't have a clue as how to import it and use it in Python,
> > > any suggestion?
> >
> > Just reimplement the widget in PyQt and follow the custom widgets
> > in designer advice described here (thanks to David Boddie, btw):
> >
> > http://diotavelli.net/PyQtWiki/Using_Python_Custom_Widgets_in_Qt_De
> >signer
> >
> > Pete
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list