111#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
112 auto points =
event->touchPoints();
113 using TouchPoint = QTouchEvent::TouchPoint;
115 auto points =
event->points();
116 using TouchPoint = QEventPoint;
120 std::count_if(points.begin(), points.end(), [=] (
const TouchPoint &point) {
121 auto state = static_cast<Qt::TouchPointState>(point.state());
122 return allowedStates.testFlag(state);
130#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
131 auto points =
event->touchPoints();
132 using TouchPoint = QTouchEvent::TouchPoint;
134 auto points =
event->points();
135 using TouchPoint = QEventPoint;
138 return std::sqrt(std::accumulate(points.begin(), points.end(), qreal(0),
139 [&] (qreal maxOffsetSq,
const TouchPoint &point) {
140 auto state =
static_cast<Qt::TouchPointState
>(point.state());
141 if (!allowedStates.testFlag(state)) {
float value(const T *src, size_t ch)
KisAbstractInputAction * action
virtual bool isAvailable(KisInputActionGroupsMask mask) const
Private(TouchGestureAction type)
bool isAvailable(KisInputActionGroupsMask mask) const override
void setIsTouchPainting(bool value)
bool matchTapType(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
bool matchDragType(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
~KisTouchShortcut() override
static qreal touchDragDistance(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
qreal minDragThreshold() const
void setMinDragThreshold(qreal value)
KisTouchShortcut(KisAbstractInputAction *action, int index, TouchGestureAction type)
bool matchHoldType(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
static int countTouchPoints(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
bool matchTouchPoint(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
void setMaximumTouchPoints(int max)
int priority() const override
void setMinimumTouchPoints(int min)
qreal normSquared(const T &a)