[PyKDE] Problem with dynamic tooltip
stsao
stsao at eudoramail.com
Sat Dec 1 00:15:40 GMT 2001
Hi,
That worked fine. I'll try to remember to do that in the future.
Again, thanks for the help.
ST
At 05:49 PM 11/30/2001 +0000, Phil Thompson wrote:
>Donovan Rebbechi wrote:
> >
> > On Wed, 28 Nov 2001, stsao wrote:
> >
> > > Hi,
> > >
> > > Thanks to Donovan, the problem has been resolved. Please see his reply
> > > below.
> > >
> > > Donavan, were you able to see the other problem (background color
> color of
> > > QMultiLineEdit not updated properly)?
> >
> > Part of the problem is that you're overriding a virtual method marked
> > "for internal use only". If you want to do this, it's a good idea to call
> > the base class version from your override.
>
>That's the right thing to do - it doesn't matter that it's marked for
>internal use - you want to supplement the existing behaviour, not
>replace it.
>
> > I get the same behaviour here as you.
> >
> > To fix it, you need to call the same method in the base class. I don't
> > know off the top of my head how to do that in python, so my brute force
> > fix is to make another method, mysetBackgroundColor.
> >
> > def mysetBackgroundColor(self, qColor):
> > palette = self.palette()
> > palette.setColor(QColorGroup.Base, qColor)
> > self.setPalette(palette)
> > self.setBackgroundColor(qColor)
>
>Just call the superclass method explicitly like you do with ctors, ie...
>
> def setBackgroundColor(self, qColor):
> palette = self.palette()
> palette.setColor(QColorGroup.Base, qColor)
> self.setPalette(palette)
> QMultiLineEdit.setBackgroundColor(self, qColor)
>
>Phil
Sheng-Te Tsao
Online Status:
<http://eudora.voicecontact.com/vc3/?tst%40eudoramail.com><http://eudora.voicecontact.com/vc3/?tst%40eudoramail.com><http://www.eudora.com/products/voicecontact/>
More information about the PyQt
mailing list