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