qgesture.sip 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // qgesture.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QGesture : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qgesture.h>
  25. %End
  26. public:
  27. explicit QGesture(QObject *parent /TransferThis/ = 0);
  28. virtual ~QGesture();
  29. Qt::GestureType gestureType() const;
  30. Qt::GestureState state() const;
  31. QPointF hotSpot() const;
  32. void setHotSpot(const QPointF &value);
  33. bool hasHotSpot() const;
  34. void unsetHotSpot();
  35. enum GestureCancelPolicy
  36. {
  37. CancelNone,
  38. CancelAllInContext,
  39. };
  40. void setGestureCancelPolicy(QGesture::GestureCancelPolicy policy);
  41. QGesture::GestureCancelPolicy gestureCancelPolicy() const;
  42. };
  43. class QPanGesture : public QGesture
  44. {
  45. %TypeHeaderCode
  46. #include <qgesture.h>
  47. %End
  48. public:
  49. explicit QPanGesture(QObject *parent /TransferThis/ = 0);
  50. virtual ~QPanGesture();
  51. QPointF lastOffset() const;
  52. QPointF offset() const;
  53. QPointF delta() const;
  54. qreal acceleration() const;
  55. void setLastOffset(const QPointF &value);
  56. void setOffset(const QPointF &value);
  57. void setAcceleration(qreal value);
  58. };
  59. class QPinchGesture : public QGesture
  60. {
  61. %TypeHeaderCode
  62. #include <qgesture.h>
  63. %End
  64. public:
  65. enum ChangeFlag /BaseType=Flag/
  66. {
  67. ScaleFactorChanged,
  68. RotationAngleChanged,
  69. CenterPointChanged,
  70. };
  71. typedef QFlags<QPinchGesture::ChangeFlag> ChangeFlags;
  72. explicit QPinchGesture(QObject *parent /TransferThis/ = 0);
  73. virtual ~QPinchGesture();
  74. QPinchGesture::ChangeFlags totalChangeFlags() const;
  75. void setTotalChangeFlags(QPinchGesture::ChangeFlags value);
  76. QPinchGesture::ChangeFlags changeFlags() const;
  77. void setChangeFlags(QPinchGesture::ChangeFlags value);
  78. QPointF startCenterPoint() const;
  79. QPointF lastCenterPoint() const;
  80. QPointF centerPoint() const;
  81. void setStartCenterPoint(const QPointF &value);
  82. void setLastCenterPoint(const QPointF &value);
  83. void setCenterPoint(const QPointF &value);
  84. qreal totalScaleFactor() const;
  85. qreal lastScaleFactor() const;
  86. qreal scaleFactor() const;
  87. void setTotalScaleFactor(qreal value);
  88. void setLastScaleFactor(qreal value);
  89. void setScaleFactor(qreal value);
  90. qreal totalRotationAngle() const;
  91. qreal lastRotationAngle() const;
  92. qreal rotationAngle() const;
  93. void setTotalRotationAngle(qreal value);
  94. void setLastRotationAngle(qreal value);
  95. void setRotationAngle(qreal value);
  96. };
  97. class QSwipeGesture : public QGesture
  98. {
  99. %TypeHeaderCode
  100. #include <qgesture.h>
  101. %End
  102. public:
  103. enum SwipeDirection
  104. {
  105. NoDirection,
  106. Left,
  107. Right,
  108. Up,
  109. Down,
  110. };
  111. explicit QSwipeGesture(QObject *parent /TransferThis/ = 0);
  112. virtual ~QSwipeGesture();
  113. QSwipeGesture::SwipeDirection horizontalDirection() const;
  114. QSwipeGesture::SwipeDirection verticalDirection() const;
  115. qreal swipeAngle() const;
  116. void setSwipeAngle(qreal value);
  117. };
  118. class QTapGesture : public QGesture
  119. {
  120. %TypeHeaderCode
  121. #include <qgesture.h>
  122. %End
  123. public:
  124. explicit QTapGesture(QObject *parent /TransferThis/ = 0);
  125. virtual ~QTapGesture();
  126. QPointF position() const;
  127. void setPosition(const QPointF &pos);
  128. };
  129. class QTapAndHoldGesture : public QGesture
  130. {
  131. %TypeHeaderCode
  132. #include <qgesture.h>
  133. %End
  134. public:
  135. explicit QTapAndHoldGesture(QObject *parent /TransferThis/ = 0);
  136. virtual ~QTapAndHoldGesture();
  137. QPointF position() const;
  138. void setPosition(const QPointF &pos);
  139. static void setTimeout(int msecs);
  140. static int timeout();
  141. };
  142. class QGestureEvent : public QEvent
  143. {
  144. %TypeHeaderCode
  145. #include <qgesture.h>
  146. %End
  147. %ConvertToSubClassCode
  148. sipType = ((sipCpp->type() == QEvent::Gesture) ? sipType_QGestureEvent : 0);
  149. %End
  150. public:
  151. explicit QGestureEvent(const QList<QGesture *> &gestures);
  152. virtual ~QGestureEvent();
  153. QList<QGesture *> gestures() const;
  154. QGesture *gesture(Qt::GestureType type) const;
  155. QList<QGesture *> activeGestures() const;
  156. QList<QGesture *> canceledGestures() const;
  157. void setAccepted(bool accepted);
  158. bool isAccepted() const;
  159. void accept();
  160. void ignore();
  161. void setAccepted(QGesture *, bool);
  162. void accept(QGesture *);
  163. void ignore(QGesture *);
  164. bool isAccepted(QGesture *) const;
  165. void setAccepted(Qt::GestureType, bool);
  166. void accept(Qt::GestureType);
  167. void ignore(Qt::GestureType);
  168. bool isAccepted(Qt::GestureType) const;
  169. QWidget *widget() const;
  170. QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
  171. };