MCPcopy Index your code
hub / github.com/PyQt5/PyQt / _drawText

Method _drawText

QProgressBar/PercentProgressBar.py:135–144  ·  view source on GitHub ↗
(self, painter: QPainter, radius: int)

Source from the content-addressed store, hash-verified

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:

Callers 1

paintEventMethod · 0.95

Calls 2

setPenMethod · 0.80
restoreMethod · 0.80

Tested by

no test coverage detected