Krita Source Code Documentation
Loading...
Searching...
No Matches
KisTouchShortcut Class Reference

The KisTouchShortcut class only handles touch gestures it does not handle tool invocation i.e painting (which is being handled in KisShortcutMatcher). More...

#include <kis_touch_shortcut.h>

+ Inheritance diagram for KisTouchShortcut:

Classes

class  Private
 

Public Member Functions

 KisTouchShortcut (KisAbstractInputAction *action, int index, GestureAction type)
 
bool matchDragType (QTouchEvent *event)
 
bool matchTapType (QTouchEvent *event)
 
bool matchTouchPoint (QTouchEvent *event)
 
int priority () const override
 
void setDisableOnTouchPainting (bool disableOnTouchPainting)
 
void setMaximumTouchPoints (int max)
 
void setMinimumTouchPoints (int min)
 
 ~KisTouchShortcut () override
 
- Public Member Functions inherited from KisAbstractShortcut
KisAbstractInputActionaction () const
 
bool isAvailable (KisInputActionGroupsMask mask) const
 
 KisAbstractShortcut (KisAbstractInputAction *action, int index)
 
void setAction (KisAbstractInputAction *action)
 
int shortcutIndex () const
 
virtual ~KisAbstractShortcut ()
 

Private Types

using GestureAction = KisShortcutConfiguration::GestureAction
 

Private Attributes

Private *const d
 

Additional Inherited Members

- Public Attributes inherited from KisAbstractShortcut
KisAbstractInputActionaction
 
int shortcutIndex
 
- Protected Member Functions inherited from KisAbstractShortcut
bool compareKeys (const QSet< Qt::Key > &keys1, const QSet< Qt::Key > &keys2)
 

Detailed Description

The KisTouchShortcut class only handles touch gestures it does not handle tool invocation i.e painting (which is being handled in KisShortcutMatcher).

Definition at line 21 of file kis_touch_shortcut.h.

Member Typedef Documentation

◆ GestureAction

Constructor & Destructor Documentation

◆ KisTouchShortcut()

KisTouchShortcut::KisTouchShortcut ( KisAbstractInputAction * action,
int index,
GestureAction type )

Definition at line 31 of file kis_touch_shortcut.cpp.

33 , d(new Private(type))
34{
35
36}
KisAbstractInputAction * action
KisAbstractShortcut(KisAbstractInputAction *action, int index)

◆ ~KisTouchShortcut()

KisTouchShortcut::~KisTouchShortcut ( )
override

Definition at line 38 of file kis_touch_shortcut.cpp.

39{
40 delete d;
41}

References d.

Member Function Documentation

◆ matchDragType()

◆ matchTapType()

◆ matchTouchPoint()

bool KisTouchShortcut::matchTouchPoint ( QTouchEvent * event)

Definition at line 81 of file kis_touch_shortcut.cpp.

82{
83 return (!d->disableOnTouchPainting || KisConfig(true).disableTouchOnCanvas())
84 && event->touchPoints().count() >= d->minTouchPoints && event->touchPoints().count() <= d->maxTouchPoints;
85}

References d, KisTouchShortcut::Private::disableOnTouchPainting, KisTouchShortcut::Private::maxTouchPoints, and KisTouchShortcut::Private::minTouchPoints.

◆ priority()

int KisTouchShortcut::priority ( ) const
overridevirtual

The priority of the shortcut. The shortcut with the greatest value will be chosen for execution

Implements KisAbstractShortcut.

Definition at line 43 of file kis_touch_shortcut.cpp.

44{
45 return action()->priority();
46}

References KisAbstractShortcut::action, and KisAbstractInputAction::priority().

◆ setDisableOnTouchPainting()

void KisTouchShortcut::setDisableOnTouchPainting ( bool disableOnTouchPainting)

Definition at line 58 of file kis_touch_shortcut.cpp.

59{
60 d->disableOnTouchPainting = disableOnTouchPainting;
61}

References d, and KisTouchShortcut::Private::disableOnTouchPainting.

◆ setMaximumTouchPoints()

void KisTouchShortcut::setMaximumTouchPoints ( int max)

Definition at line 53 of file kis_touch_shortcut.cpp.

54{
56}
constexpr std::enable_if< sizeof...(values)==0, size_t >::type max()

References d, and KisTouchShortcut::Private::maxTouchPoints.

◆ setMinimumTouchPoints()

void KisTouchShortcut::setMinimumTouchPoints ( int min)

Definition at line 48 of file kis_touch_shortcut.cpp.

49{
51}
T min(T a, T b, T c)

References d, and KisTouchShortcut::Private::minTouchPoints.

Member Data Documentation

◆ d

Private* const KisTouchShortcut::d
private

Definition at line 41 of file kis_touch_shortcut.h.


The documentation for this class was generated from the following files: