PDA

View Full Version : Translucent window background in 4.3.2 - possible?



dpimka
14th July 2009, 12:48
Hi!

I have a top-level window which is painted using QPixmap with varying alpha-channel. With Qt 4.5.x I use setAttribute( Qt::WA_TranslucentBackground) to make these regions semi-transparent depending on alpha value.

Now I have the need to achieve the same effect with Qt 4.3.2 (please don't ask me why 4.3.2, I have my reasons ;) ).

I can't find a way to do this, perhaps someone can give me an advice? Is it possible at all?

QLabel::setMask() won't do, because it only respects alpha 0 and alpha 1, not a values in between.

ntp
14th July 2009, 21:28
Do you only want part of the windows transparent? If so, then I think you'll have to go into Qt source code and make the changes yourself.

If you want the whole app to have some sort of transparency, you can use QWidget::setWindowOpacity(qreal level);

dpimka
15th July 2009, 08:53
The first case: I want to draw a custom shadow with ranging alpha value on the sides of my window, while other parts staying opaque.

Ok, thanks, perhaps I'll try to search on how QA_TranslucentBackground is implemented in 4.5.x...