diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-02-19 10:06:25 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-02-19 10:06:25 +0100 |
commit | 30fd22b9574def54726e7b193127cc0c901c1b4c (patch) | |
tree | 96dfc923044db0515064ba39d052d9ed577e3e40 /src/widgets/doc/snippets/customstyle/customstyle.cpp | |
parent | d7b0581c1c2ef60c08d238dae39298af6904918f (diff) | |
parent | 6aa09bbce59828d028f6d1e81d2bfc6ba537aae1 (diff) |
Merge remote-tracking branch 'origin/dev' into stable
Change-Id: Ice524edcc51373509f0023ae7f7c2963f4602f88
Diffstat (limited to 'src/widgets/doc/snippets/customstyle/customstyle.cpp')
-rw-r--r-- | src/widgets/doc/snippets/customstyle/customstyle.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.cpp b/src/widgets/doc/snippets/customstyle/customstyle.cpp index 9d00745e6a..b5d44ebecd 100644 --- a/src/widgets/doc/snippets/customstyle/customstyle.cpp +++ b/src/widgets/doc/snippets/customstyle/customstyle.cpp @@ -57,32 +57,32 @@ void CustomStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op QPainter *painter, const QWidget *widget) const { if (element == PE_IndicatorSpinUp || element == PE_IndicatorSpinDown) { - QPolygon points(3); - int x = option->rect.x(); - int y = option->rect.y(); - int w = option->rect.width() / 2; - int h = option->rect.height() / 2; - x += (option->rect.width() - w) / 2; - y += (option->rect.height() - h) / 2; + QPolygon points(3); + int x = option->rect.x(); + int y = option->rect.y(); + int w = option->rect.width() / 2; + int h = option->rect.height() / 2; + x += (option->rect.width() - w) / 2; + y += (option->rect.height() - h) / 2; - if (element == PE_IndicatorSpinUp) { - points[0] = QPoint(x, y + h); - points[1] = QPoint(x + w, y + h); - points[2] = QPoint(x + w / 2, y); - } else { // PE_SpinBoxDown - points[0] = QPoint(x, y); - points[1] = QPoint(x + w, y); - points[2] = QPoint(x + w / 2, y + h); - } + if (element == PE_IndicatorSpinUp) { + points[0] = QPoint(x, y + h); + points[1] = QPoint(x + w, y + h); + points[2] = QPoint(x + w / 2, y); + } else { // PE_SpinBoxDown + points[0] = QPoint(x, y); + points[1] = QPoint(x + w, y); + points[2] = QPoint(x + w / 2, y + h); + } - if (option->state & State_Enabled) { - painter->setPen(option->palette.mid().color()); - painter->setBrush(option->palette.buttonText()); - } else { - painter->setPen(option->palette.buttonText().color()); - painter->setBrush(option->palette.mid()); - } - painter->drawPolygon(points); + if (option->state & State_Enabled) { + painter->setPen(option->palette.mid().color()); + painter->setBrush(option->palette.buttonText()); + } else { + painter->setPen(option->palette.buttonText().color()); + painter->setBrush(option->palette.mid()); + } + painter->drawPolygon(points); } else { QProxyStyle::drawPrimitive(element, option, painter, widget); //! [2] //! [3] |