Skip to content

GestureMixin

Sub classes

Name Children Inherits
Gesture
prettyqt.widgets.gesture
A gesture, containing properties that describe the corresponding user input.
    TapGesture
    prettyqt.widgets.tapgesture
    Describes a tap gesture made by the user.
      TapAndHoldGesture
      prettyqt.widgets.tapandholdgesture
        PanGesture
        prettyqt.widgets.pangesture
        Describes a panning gesture made by the user.
          PinchGesture
          prettyqt.widgets.pinchgesture
          Describes a pinch gesture made by the user.
            SwipeGestureMixin
            prettyqt.widgets.swipegesture

            Base classes

            Name Children Inherits
            ObjectMixin
            prettyqt.core.object
            object
            builtins
            The base class of the class hierarchy.
            • type
            • async_generator
            • bytearray_iterator
            • bytearray
            • bytes_iterator
            • bytes
            • builtin_function_or_method
            • callable_iterator
            • PyCapsule
            • cell
            • classmethod_descriptor
            • ...

              ⋔ Inheritance diagram

              graph TD
                2553044129["widgets.GestureMixin"]
                3227531497["core.ObjectMixin"]
                2751680898["builtins.object"]
                3227531497 --> 2553044129
                2751680898 --> 3227531497
                2751680898 --> 2553044129

              🛈 DocStrings

              Bases: ObjectMixin, _GestureBase

              Source code in prettyqt/widgets/gesture.py
              class GestureMixin(core.ObjectMixin, _GestureBase):
                  def get_state(self) -> constants.GestureStateStr:
                      """Return current state.
              
                      Returns:
                          state
                      """
                      return constants.GESTURE_STATE.inverse[self.state()]
              
                  def get_gesture_type(self) -> constants.GestureTypeStr:
                      """Return current gesture type.
              
                      Returns:
                          gesture type
                      """
                      return constants.GESTURE_TYPE.inverse[self.gestureType()]
              
                  def get_hot_spot(self) -> core.PointF:
                      return core.PointF(self.hotSpot())
              
                  def set_gesture_cancel_policy(
                      self, policy: GestureCancelPolicyStr | widgets.QGesture.GestureCancelPolicy
                  ):
                      """Set gesture cancel policy.
              
                      Args:
                          policy: gesture cancel policy to use
                      """
                      self.setGestureCancelPolicy(GESTURE_CANCEL_POLICY.get_enum_value(policy))
              
                  def get_gesture_cancel_policy(self) -> GestureCancelPolicyStr:
                      """Return current gesture cancel policy.
              
                      Returns:
                          gesture cancel policy
                      """
                      return GESTURE_CANCEL_POLICY.inverse[self.gestureCancelPolicy()]
              

              get_gesture_cancel_policy() -> GestureCancelPolicyStr

              Return current gesture cancel policy.

              Source code in prettyqt/widgets/gesture.py
              def get_gesture_cancel_policy(self) -> GestureCancelPolicyStr:
                  """Return current gesture cancel policy.
              
                  Returns:
                      gesture cancel policy
                  """
                  return GESTURE_CANCEL_POLICY.inverse[self.gestureCancelPolicy()]
              

              get_gesture_type() -> constants.GestureTypeStr

              Return current gesture type.

              Source code in prettyqt/widgets/gesture.py
              def get_gesture_type(self) -> constants.GestureTypeStr:
                  """Return current gesture type.
              
                  Returns:
                      gesture type
                  """
                  return constants.GESTURE_TYPE.inverse[self.gestureType()]
              

              get_state() -> constants.GestureStateStr

              Return current state.

              Source code in prettyqt/widgets/gesture.py
              def get_state(self) -> constants.GestureStateStr:
                  """Return current state.
              
                  Returns:
                      state
                  """
                  return constants.GESTURE_STATE.inverse[self.state()]
              

              set_gesture_cancel_policy(policy: GestureCancelPolicyStr | widgets.QGesture.GestureCancelPolicy)

              Set gesture cancel policy.

              Parameters:

              Name Type Description Default
              policy GestureCancelPolicyStr | GestureCancelPolicy

              gesture cancel policy to use

              required
              Source code in prettyqt/widgets/gesture.py
              def set_gesture_cancel_policy(
                  self, policy: GestureCancelPolicyStr | widgets.QGesture.GestureCancelPolicy
              ):
                  """Set gesture cancel policy.
              
                  Args:
                      policy: gesture cancel policy to use
                  """
                  self.setGestureCancelPolicy(GESTURE_CANCEL_POLICY.get_enum_value(policy))
              

              :fa-brands-github: Show source on GitHub