11#include <klocalizedstring.h>
38 d->indexes.insert(i18n(
"Activate"), 0);
62 d->startCursorPosition =
d->lastCursorPosition;
72 d->lastCursorPosition = newPosition;
107 return Private::inputManager;
117 return d->description;
157 Private::inputManager = manager;
172 switch (event->type()) {
173 case QEvent::MouseMove:
174 case QEvent::MouseButtonPress:
175 case QEvent::MouseButtonDblClick:
176 case QEvent::MouseButtonRelease:
177 return static_cast<const QMouseEvent*
>(event)->pos();
179 case QEvent::TabletMove:
180 case QEvent::TabletPress:
181 case QEvent::TabletRelease:
182 return static_cast<const QTabletEvent*
>(event)->pos();
184 case QEvent::TouchBegin:
185 case QEvent::TouchUpdate:
186 case QEvent::TouchEnd:
187 return static_cast<const QTouchEvent *
>(event)->touchPoints().at(0).pos().toPoint();
190 return static_cast<const QWheelEvent*
>(event)->position().toPoint();
192 case QEvent::NativeGesture: {
202#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
203 return canvas->
canvasWidget()->mapFromGlobal(QPointF(
static_cast<const QNativeGestureEvent*
>(event)->globalPos())).toPoint();
205 return canvas->
canvasWidget()->mapFromGlobal(
static_cast<const QNativeGestureEvent*
>(event)->globalPos());
210 warnInput <<
"KisAbstractInputAction" <<
d->name <<
"tried to process event data from an unhandled event type" <<
event->type();
217 switch (event->type()) {
218 case QEvent::MouseMove:
219 case QEvent::MouseButtonPress:
220 case QEvent::MouseButtonDblClick:
221 case QEvent::MouseButtonRelease:
222 return static_cast<const QMouseEvent*
>(event)->localPos();
224 case QEvent::TabletMove:
225 case QEvent::TabletPress:
226 case QEvent::TabletRelease:
227 return static_cast<const QTabletEvent*
>(event)->posF();
229 case QEvent::TouchBegin:
230 case QEvent::TouchUpdate:
231 case QEvent::TouchEnd:
232 return static_cast<const QTouchEvent *
>(event)->touchPoints().at(0).pos();
235 return static_cast<const QWheelEvent*
>(event)->position();
237 case QEvent::NativeGesture: {
247#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
248 return canvas->
canvasWidget()->mapFromGlobal(QPointF(
static_cast<const QNativeGestureEvent*
>(event)->globalPos()));
250 return canvas->
canvasWidget()->mapFromGlobal(
static_cast<const QNativeGestureEvent*
>(event)->globalPos());
254 warnInput <<
"KisAbstractInputAction" <<
d->name <<
"tried to process event data from an unhandled event type" <<
event->type();
KisAbstractCanvasWidget * canvasWidget
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)