77{
78 QPainter painter(this);
79
80 QColor backGroundColor = qApp->palette().light().color();
81 QColor foregroundColor = qApp->palette().windowText().color();
84 QColor outlineColor = QColor::fromRgb(256*(
r1*backGroundColor.redF() +
r2*foregroundColor.redF()),
85 256*(
r1*backGroundColor.greenF() +
r2*foregroundColor.greenF()),
86 256*(
r1*backGroundColor.blueF() +
r2*foregroundColor.blueF()));
87
88
89 QBrush windowB = qApp->palette().window();
90 QBrush windowTextB = qApp->palette().windowText();
91
92 QWidget::paintEvent(event);
93 painter.setRenderHint(QPainter::Antialiasing);
94 QPainterPath path;
95 path.addRoundedRect(this->
rect(), 6, 6);
96
97
98 painter.fillPath(path, qApp->palette().light());
99
101
102 QPen penwt = QPen(outlineColor, 1);
103 penwt.setStyle(Qt::DashLine);
104
105 QPainterPath outlinePath;
106 outlinePath.addRoundedRect(this->
rect().adjusted(1, 1, -1, -1), 4, 4);
107
108 painter.setPen(penwt);
109 painter.drawPath(outlinePath);
110 }
111
112}