def rescale(self):
fm = QFontMetricsF(self._font, self)
maxRect = fm.boundingRect(QRectF(self.rect()), Qt.AlignCenter,
str(self._maximum))
xscale = float(self.width())/maxRect.width()
yscale = float(self.height())/maxRect.height()
self._scale = min(xscale, yscale)
评论列表
文章目录