PDA

View Full Version : Widget Overlapping picture



bunjee
23rd November 2009, 17:50
Hey guys,

I want to achieve the following.

- Create a QWidget, say a QPushButton.
- Create another QWidget.
- Subclass its paintEvent method and paint a gradient.
- Overlap my QPushButton with the QWidget gradient.
- Still get mouse events on my QPushButton.

What's the best way for doing that ?

Thanks.

aamer4yu
24th November 2009, 04:26
Do you mean having a gradient for pushbutton ? Why cant u set background color of the push button as gradient ?

If you want button on top, use semi transparent color for the button. You will see background gradient as well as receive the events

bunjee
24th November 2009, 14:50
I mean having a widget on top of another that redirects every mouse interaction to the background widget.