QTfrontend/igbox.cpp
changeset 1193 2911384169b4
parent 1192 63b7961f68de
child 1209 7f6cb1d7be2a
equal deleted inserted replaced
1192:63b7961f68de 1193:2911384169b4
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  */
    17  */
    18 
    18 
    19 #include <QPainter>
    19 #include <QPainter>
    20 #include <QPoint>
    20 #include <QPoint>
       
    21 #include <QStylePainter>
       
    22 #include <QStyleOptionGroupBox>
       
    23 
    21 #include "igbox.h"
    24 #include "igbox.h"
    22 
    25 
    23 IconedGroupBox::IconedGroupBox(QWidget * parent)
    26 IconedGroupBox::IconedGroupBox(QWidget * parent)
    24 {
    27 {
    25 
    28 
    30 	this->icon = icon;
    33 	this->icon = icon;
    31 }
    34 }
    32 
    35 
    33 void IconedGroupBox::paintEvent(QPaintEvent * event)
    36 void IconedGroupBox::paintEvent(QPaintEvent * event)
    34 {
    37 {
    35 	QPainter painter(this);
    38 	QStylePainter painter(this);
    36 
    39 
    37 	icon.paint(&painter, QRect(QPoint(0, 0), size()));
    40 	QStyleOptionGroupBox option;
       
    41 	initStyleOption(&option);
       
    42 	painter.drawComplexControl(QStyle::CC_GroupBox, option);
       
    43 
       
    44 	icon.paint(&painter, QRect(QPoint(0, 0), icon.actualSize(size())));
    38 }
    45 }