A problem with QPushButton on a plasma applet

Jason Stubbs jasonbstubbs at gmail.com
Mon May 26 17:30:14 CEST 2008


On Thursday 22 May 2008 01:09:33 JST, Alexis Ménard wrote:
> Calling this on a QWidget remove grey boxes we have (if we talk about the
> same boxes) :
>
> mWidget->setAttribute(Qt::WA_NoSystemBackground);
> mWidget->setAutoFillBackground (false);
>
> One example is notes applet wich call these two lines...It allow the
> embeeded widget to be transparent...

This is not really the best way to make a widget transparent. Given a label, 
for example, it will appear fine at first but will become garbled if you 
change its text. Furthermore, changes to the parent widget that lie 
underneath won't show through. At least that's what will happen with real 
widgets; I haven't tried it with alien widgets on a canvas.

Any reason why Toussis Manolis's code (below) doesn't work? If using 
NoSystemBackground is the only way then this issue should really be sent 
upstream.

QPalette pal1(m_buttonNext->palette());
pal1.setColor(QPalette::Window, Qt::transparent);
m_buttonNext->setPalette(pal1);
m_buttonNext->setBackgroundRole(QPalette::Window);

-- 
Jason Stubbs


More information about the Panel-devel mailing list