Skip to content

PinchGesture

Qt Base Class: QPinchGesture

Signature: QPinchGesture(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
GestureMixin
prettyqt.widgets.gesture
QPinchGesture
PySide6.QtWidgets
QPinchGesture(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473296379840["widgets.PinchGesture"]
  1473296392528["widgets.GestureMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473293734112["QtWidgets.QPinchGesture"]
  1473293749728["QtWidgets.QGesture"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473296392528 --> 1473296379840
  1473299815024 --> 1473296392528
  140713234304496 --> 1473299815024
  1473293734112 --> 1473296379840
  1473293749728 --> 1473293734112
  1473288842240 --> 1473293749728
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: GestureMixin, QPinchGesture

Describes a pinch gesture made by the user.

Source code in prettyqt\widgets\pinchgesture.py
class PinchGesture(widgets.GestureMixin, widgets.QPinchGesture):
    """Describes a pinch gesture made by the user."""

    def get_start_center_point(self) -> core.PointF:
        return core.PointF(self.startCenterPoint())

    def get_center_point(self) -> core.PointF:
        return core.PointF(self.centerPoint())

    def get_last_center_point(self) -> core.PointF:
        return core.PointF(self.lastCenterPoint())

    def get_change_flags(self) -> list[ChangeFlagStr]:
        return CHANGE_FLAGS.get_list(self.changeFlags())

    def set_change_flags(self, **kwargs):
        val = widgets.QPinchGesture.ChangeFlag(0)
        for k, v in kwargs.items():
            if v is True:
                val |= CHANGE_FLAGS[k]
        flag = widgets.QPinchGesture.ChangeFlag(val)  # type: ignore
        self.setChangeFlags(flag)  # type: ignore

    def get_total_change_flags(self) -> list[ChangeFlagStr]:
        return CHANGE_FLAGS.get_list(self.totalChangeFlags())

    def set_total_change_flags(self, **kwargs):
        val = widgets.QPinchGesture.ChangeFlag(0)
        for k, v in kwargs.items():
            if v is True:
                val |= CHANGE_FLAGS[k]
        flag = widgets.QPinchGesture.ChangeFlag(val)  # type: ignore
        self.setTotalChangeFlags(flag)  # type: ignore

⌗ Property table

Qt Property Type Doc
objectName QString
state Qt::GestureState
gestureType Qt::GestureType
gestureCancelPolicy QGesture::GestureCancelPolicy
hotSpot QPointF
hasHotSpot bool
totalChangeFlags QFlags
changeFlags QFlags
totalScaleFactor double
lastScaleFactor double
scaleFactor double
totalRotationAngle double
lastRotationAngle double
rotationAngle double
startCenterPoint QPointF
lastCenterPoint QPointF
centerPoint QPointF