| 34 | BackgroundColor = QColor(70, 70, 70) # 背景颜色 |
| 35 | |
| 36 | def __init__(self, *args, value=0, minValue=0, maxValue=100, |
| 37 | borderWidth=8, clockwise=True, showPercent=True, |
| 38 | showFreeArea=False, showSmallCircle=False, |
| 39 | textColor=QColor(255, 255, 255), |
| 40 | borderColor=QColor(24, 189, 155), |
| 41 | backgroundColor=QColor(70, 70, 70), **kwargs): |
| 42 | super(PercentProgressBar, self).__init__(*args, **kwargs) |
| 43 | self.Value = value |
| 44 | self.MinValue = minValue |
| 45 | self.MaxValue = maxValue |
| 46 | self.BorderWidth = borderWidth |
| 47 | self.Clockwise = clockwise |
| 48 | self.ShowPercent = showPercent |
| 49 | self.ShowFreeArea = showFreeArea |
| 50 | self.ShowSmallCircle = showSmallCircle |
| 51 | self.TextColor = textColor |
| 52 | self.BorderColor = borderColor |
| 53 | self.BackgroundColor = backgroundColor |
| 54 | |
| 55 | def setRange(self, minValue: int, maxValue: int): |
| 56 | if minValue >= maxValue: # 最小值>=最大值 |