MCPcopy Create free account
hub / github.com/PyQt5/PyQt / zoom

Method zoom

QListView/ImageView.py:129–138  ·  view source on GitHub ↗

缩放 :param factor: 缩放的比例因子

(self, factor)

Source from the content-addressed store, hash-verified

127 self.zoom(1 - self._delta)
128
129 def zoom(self, factor):
130 """缩放
131 :param factor: 缩放的比例因子
132 """
133 _factor = self.transform().scale(
134 factor, factor).mapRect(QRectF(0, 0, 1, 1)).width()
135 if _factor < 0.07 or _factor > 100:
136 # 防止过大过小
137 return
138 self.scale(factor, factor)
139
140
141class ImageView(QListView):

Callers 2

zoomInMethod · 0.95
zoomOutMethod · 0.95

Calls 1

widthMethod · 0.45

Tested by

no test coverage detected