Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_native_gesture_shortcut.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Bernhard Liebl <poke1024@gmx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 *
6 */
7
9
10#include <QNativeGestureEvent>
11
19
21 : KisAbstractShortcut(action, index), d(new Private)
22{
23 d->type = type;
24}
25
30
32{
33 return 0;
34}
35
36bool KisNativeGestureShortcut::match(QNativeGestureEvent* event)
37{
38 if (d->type == PinchNavigation) {
39 return event->gestureType() == Qt::PanNativeGesture || event->gestureType() == Qt::ZoomNativeGesture
40 || event->gestureType() == Qt::RotateNativeGesture;
41 } else if (d->type == SmartZoomNativeGesture) {
42 return event->gestureType() == Qt::SmartZoomNativeGesture;
43 }
44
45 return false;
46}
Abstract base class for input actions.
bool match(QNativeGestureEvent *event)
KisNativeGestureShortcut(KisAbstractInputAction *action, int index, Type type)