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

Method zoom

QGraphicsView/ImageView.py:128–137  ·  view source on GitHub ↗

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

(self, factor)

Source from the content-addressed store, hash-verified

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

Callers 2

zoomInMethod · 0.95
zoomOutMethod · 0.95

Calls 1

widthMethod · 0.45

Tested by

no test coverage detected