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

#include <kis_selection_modifier_mapper.h>

+ Inheritance diagram for KisSelectionModifierMapper:

Public Slots

void slotConfigChanged ()
 

Public Member Functions

 KisSelectionModifierMapper ()
 
SelectionAction map (Qt::KeyboardModifiers m)
 
void slotConfigChanged ()
 
 ~KisSelectionModifierMapper () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Static Public Member Functions

static KisSelectionModifierMapperinstance ()
 
static SelectionAction map (Qt::KeyboardModifiers m)
 

Public Attributes

Qt::KeyboardModifiers addModifiers
 
Qt::KeyboardModifiers intersectModifiers
 
Qt::KeyboardModifiers replaceModifiers
 
Qt::KeyboardModifiers subtractModifiers
 
Qt::KeyboardModifiers symmetricdifferenceModifiers
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

This is a basic template to create selection tools from basic path based drawing tools. The template overrides the ability to execute alternate actions correctly. Modifier keys are overridden with the following behavior:

Shift: add to selection Alt: subtract from selection Shift+Alt: intersect current selection Ctrl: replace selection

Certain tools also use modifier keys to alter their behavior, e.g. forcing square proportions with the rectangle tool. The template enables the following rules for forwarding keys: 1) Any modifier keys held when the tool is first activated will determine the new selection method. 2) If the underlying tool does not take modifier keys, pressing modifier keys in the middle of a stroke will change the selection method. This applies to the lasso tool and polygon tool. 3) If the underlying tool takes modifier keys, they will always be forwarded to the underlying tool, and it is not possible to change the selection method in the middle of a stroke.

See KisToolSelectBase for usage.

Definition at line 41 of file kis_selection_modifier_mapper.cc.

Constructor & Destructor Documentation

◆ KisSelectionModifierMapper()

KisSelectionModifierMapper::KisSelectionModifierMapper ( )

Definition at line 53 of file kis_selection_modifier_mapper.cc.

54 : m_d(new Private)
55{
57 SIGNAL(configChanged()),
58 SLOT(slotConfigChanged()));
60}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
static KisConfigNotifier * instance()
const QScopedPointer< Private > m_d

References connect(), KisConfigNotifier::instance(), and slotConfigChanged().

◆ ~KisSelectionModifierMapper()

KisSelectionModifierMapper::~KisSelectionModifierMapper ( )
override

Definition at line 63 of file kis_selection_modifier_mapper.cc.

64{
65}

Member Function Documentation

◆ instance()

KisSelectionModifierMapper * KisSelectionModifierMapper::instance ( )
static

Definition at line 67 of file kis_selection_modifier_mapper.cc.

68{
69 return s_instance;
70}

◆ map() [1/2]

SelectionAction KisSelectionModifierMapper::map ( Qt::KeyboardModifiers m)

Definition at line 96 of file kis_selection_modifier_mapper.cc.

97{
98 return s_instance->m_d->map(m);
99}

◆ map() [2/2]

static SelectionAction KisSelectionModifierMapper::map ( Qt::KeyboardModifiers m)
static

◆ slotConfigChanged() [1/2]

void KisSelectionModifierMapper::slotConfigChanged ( )

Definition at line 72 of file kis_selection_modifier_mapper.cc.

73{
74 m_d->slotConfigChanged();
75}

References m_d, and slotConfigChanged().

◆ slotConfigChanged [2/2]

void KisSelectionModifierMapper::slotConfigChanged ( )
slot

Member Data Documentation

◆ addModifiers

Qt::KeyboardModifiers KisSelectionModifierMapper::addModifiers

Definition at line 47 of file kis_selection_modifier_mapper.cc.

◆ intersectModifiers

Qt::KeyboardModifiers KisSelectionModifierMapper::intersectModifiers

Definition at line 46 of file kis_selection_modifier_mapper.cc.

◆ m_d

const QScopedPointer<Private> KisSelectionModifierMapper::m_d
private

Definition at line 32 of file kis_selection_modifier_mapper.h.

◆ replaceModifiers

Qt::KeyboardModifiers KisSelectionModifierMapper::replaceModifiers

Definition at line 45 of file kis_selection_modifier_mapper.cc.

◆ subtractModifiers

Qt::KeyboardModifiers KisSelectionModifierMapper::subtractModifiers

Definition at line 48 of file kis_selection_modifier_mapper.cc.

◆ symmetricdifferenceModifiers

Qt::KeyboardModifiers KisSelectionModifierMapper::symmetricdifferenceModifiers

Definition at line 49 of file kis_selection_modifier_mapper.cc.


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