Example #1
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         step = event.angleDelta().y() / 120.0
         self.zoom(step, event.pos())
         self.pointSizeModified.emit(self._impliedPointSize)
         event.accept()
     else:
         super(GlyphWidget, self).wheelEvent(event)
Example #2
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         font = self.font()
         newPointSize = font.pointSize() + event.angleDelta().y() / 120.0
         if newPointSize < 6:
             return
         font.setPointSize(newPointSize)
         self.setFont(font)
     else:
         super(BaseCodeEditor, self).wheelEvent(event)
Example #3
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         font = self.font()
         newPointSize = font.pointSize() + event.angleDelta().y() / 120.0
         if newPointSize < 6:
             return
         font.setPointSize(newPointSize)
         self.setFont(font)
     else:
         super(BaseCodeEditor, self).wheelEvent(event)
Example #4
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         scale = pow(1.2, event.angleDelta().y() / 120.0)
         pointSize = round(self._pointSize * scale)
         if pointSize <= 0:
             return
         self.setPointSize(pointSize)
         self.pointSizeModified.emit(pointSize)
         event.accept()
     else:
         super().wheelEvent(event)
Example #5
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         scale = pow(1.2, event.angleDelta().y() / 120.0)
         pointSize = round(self._pointSize * scale)
         if pointSize <= 0:
             return
         self.setPointSize(pointSize)
         self.pointSizeModified.emit(pointSize)
         event.accept()
     else:
         super(GlyphLineWidget, self).wheelEvent(event)
Example #6
0
 def wheelEvent(self, event):
     if event.modifiers() & platformSpecific.scaleModifier():
         step = event.angleDelta().y() / 120.0
         newScale = self._scale * pow(1.2, step)
         self.zoom(newScale, event.pos())
         self.pointSizeModified.emit(self._impliedPointSize)
     else:
         delta = event.pixelDelta()
         if delta.isNull():
             delta = event.angleDelta()
             dx = delta.x() / 120 * QApplication.wheelScrollLines() * 8
             dy = delta.y() / 120 * QApplication.wheelScrollLines() * 8
             delta = QPoint(dx, dy)
         self._drawingOffset += delta
         self.update()
     event.accept()