20 QPainter *painter,
const QWidget *widget)
const
22 if (element == PE_IndicatorSpinUp || element == PE_IndicatorSpinDown) {
24 int x = option->rect.x();
25 int y = option->rect.y();
26 int w = option->rect.width() / 2;
27 int h = option->rect.height() / 2;
28 x += (option->rect.width() - w) / 2;
29 y += (option->rect.height() - h) / 2;
31 if (element == PE_IndicatorSpinUp) {
32 points[0] = QPoint(x, y + h);
33 points[1] = QPoint(x + w, y + h);
34 points[2] = QPoint(x + w / 2, y);
36 points[0] = QPoint(x, y);
37 points[1] = QPoint(x + w, y);
38 points[2] = QPoint(x + w / 2, y + h);
41 if (option->state & State_Enabled) {
42 painter->setPen(option->palette.mid().color());
43 painter->setBrush(option->palette.buttonText());
45 painter->setPen(option->palette.buttonText().color());
46 painter->setBrush(option->palette.mid());
48 painter->drawPolygon(points);
50 QProxyStyle::drawPrimitive(element, option, painter, widget);