(self, painter: QPainter, radius: int)
| 133 | painter.restore() |
| 134 | |
| 135 | def _drawText(self, painter: QPainter, radius: int): |
| 136 | # 绘制文字 |
| 137 | painter.save() |
| 138 | painter.setPen(self.TextColor) |
| 139 | painter.setFont(QFont('Arial', 25)) |
| 140 | strValue = '{}%'.format(int(self.Value / (self.MaxValue - self.MinValue) |
| 141 | * 100)) if self.ShowPercent else str(self.Value) |
| 142 | painter.drawText(QRectF(-radius, -radius, radius * 2, |
| 143 | radius * 2), Qt.AlignCenter, strValue) |
| 144 | painter.restore() |
| 145 | |
| 146 | @pyqtProperty(int) |
| 147 | def minValue(self) -> int: |
no test coverage detected