49 QPainter painter(
this);
52 painter.setRenderHint(QPainter::Antialiasing);
53 painter.setPen(Qt::transparent);
58 QRect viewRect =
rect();
62 QRect edgeRect = viewRect;
68 QColor outsideColor =
palette().base().color();
69 painter.setBrush(outsideColor);
71 painter.fillPath(edge, outsideColor);
74 int maxWidth = viewRect.width();
76 int innerWidth =
m_diameter - 2*thicknessPixels;
78 int outsideWidths = maxWidth - innerWidth - 2*thicknessPixels;
79 int outsideWidth = outsideWidths/2;
83 QRect leftSide = QRect(QPoint(), QPoint(thicknessPixels, viewRect.height()));
84 leftSide.translate(viewRect.topLeft());
85 QRect rightSide = leftSide;
86 leftSide.translate(outsideWidth, 0);
87 rightSide.translate(maxWidth - outsideWidth - thicknessPixels, 0);
89 QRect leftBottom = QRect(QPoint(leftSide.left(), leftSide.top() + leftSide.height()/2), QPoint(leftSide.bottomRight()));
90 QRect leftTop = QRect(leftSide.topLeft(), QPoint(leftSide.right(), leftSide.top() + leftSide.height()/2));
92 QRect rightBottom = QRect(QPoint(rightSide.left(), rightSide.top() + rightSide.height()/2), QPoint(rightSide.bottomRight()));
93 QRect rightTop = QRect(rightSide.topLeft(), QPoint(rightSide.right(), rightSide.top() + rightSide.height()/2));
102 painter.setBrush(Qt::transparent);
109 QColor crossColor = Qt::white;
110 crossColor.setAlphaF(0.4);
111 painter.setPen(crossColor);
113 QPointF center = viewRect.topLeft() + QPoint(viewRect.width()/2, viewRect.height()/2);
122 QColor darkTransparent =
palette().dark().color();
125 painter.setPen(QPen(darkTransparent, 2));
127 painter.drawPath(edge);