PDA

View Full Version : A Shadow of my groupBox



baray98
26th June 2008, 07:38
I used QGroupbox to encapsulate some data for the user and i want to get fancy! I want to make a shadow to make it float on the containing widget. I am thinking of overiding the paint on this QGroupbox, but i am not too sure how can i draw the widget inside my groupbox now. since i will mess up the paint on it.

If you guys can show/help/ give some sample code in playing with the paint on QGroupBox that will be highly appreciated.

baray98

jpn
28th June 2008, 21:41
Use style sheets (http://doc.trolltech.com/4.4/stylesheet-reference.html#margin-prop) or QWidget::setContentsMargins() to reserve some margins for the shadow and override QWidget::paintEvent() to draw it. Don't forget to call the base class implementation to get group box title and frame.