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

A container class for sets of shortcuts associated with an action. More...

#include <kis_input_profile.h>

+ Inheritance diagram for KisInputProfile:

Classes

class  Private
 

Public Slots

void setName (const QString &name)
 

Signals

void nameChanged ()
 

Public Member Functions

void addShortcut (KisShortcutConfiguration *shortcut)
 
QList< KisShortcutConfiguration * > allShortcuts () const
 
 KisInputProfile (QObject *parent=0)
 
QString name () const
 
void removeShortcut (KisShortcutConfiguration *shortcut)
 
QList< KisShortcutConfiguration * > shortcutsForAction (KisAbstractInputAction *action) const
 
 ~KisInputProfile () override
 

Private Attributes

Private *const d
 

Detailed Description

A container class for sets of shortcuts associated with an action.

Definition at line 21 of file kis_input_profile.h.

Constructor & Destructor Documentation

◆ KisInputProfile()

KisInputProfile::KisInputProfile ( QObject * parent = 0)

Constructor.

Definition at line 28 of file kis_input_profile.cpp.

29 : QObject(parent), d(new Private())
30{
31
32}
Private *const d

◆ ~KisInputProfile()

KisInputProfile::~KisInputProfile ( )
override

Destructor.

Definition at line 34 of file kis_input_profile.cpp.

35{
36 delete d;
37}

References d.

Member Function Documentation

◆ addShortcut()

void KisInputProfile::addShortcut ( KisShortcutConfiguration * shortcut)

Add a shortcut to this profile.

Parameters
shortcutThe shortcut to add.

Definition at line 65 of file kis_input_profile.cpp.

66{
67 Q_ASSERT(shortcut);
68 Q_ASSERT(shortcut->action());
69 d->shortcuts.insert(shortcut->action(), shortcut);
70}
QMultiHash< KisAbstractInputAction *, KisShortcutConfiguration * > shortcuts
KisAbstractInputAction * action() const

References KisShortcutConfiguration::action(), d, and KisInputProfile::Private::shortcuts.

◆ allShortcuts()

QList< KisShortcutConfiguration * > KisInputProfile::allShortcuts ( ) const
Returns
A list of all shortcuts available.

Definition at line 51 of file kis_input_profile.cpp.

52{
53 return d->shortcuts.values();
54}

References d, and KisInputProfile::Private::shortcuts.

◆ name()

QString KisInputProfile::name ( ) const
Returns
The name of the profile.

Definition at line 39 of file kis_input_profile.cpp.

40{
41 return d->name;
42}

References d, and KisInputProfile::Private::name.

◆ nameChanged

void KisInputProfile::nameChanged ( )
signal

Emitted when the name of this profile changes.

◆ removeShortcut()

void KisInputProfile::removeShortcut ( KisShortcutConfiguration * shortcut)

Remove a shortcut from this profile.

Parameters
shortcutThe shortcut to remove.

Definition at line 72 of file kis_input_profile.cpp.

73{
74 Q_ASSERT(shortcut);
75 Q_ASSERT(shortcut->action());
76 d->shortcuts.remove(shortcut->action(), shortcut);
77}

References KisShortcutConfiguration::action(), d, and KisInputProfile::Private::shortcuts.

◆ setName

void KisInputProfile::setName ( const QString & name)
slot

Set the name of this profile.

Parameters
nameThe name to set.

Definition at line 43 of file kis_input_profile.cpp.

44{
45 if (d->name != name) {
46 d->name = name;
47 Q_EMIT nameChanged();
48 }
49}
QString name() const

References d, KisInputProfile::Private::name, name(), and nameChanged().

◆ shortcutsForAction()

QList< KisShortcutConfiguration * > KisInputProfile::shortcutsForAction ( KisAbstractInputAction * action) const
Returns
A list of shortcuts associated with the given action.
Parameters
actionThe action for which to list the shortcuts.

Definition at line 56 of file kis_input_profile.cpp.

57{
58 if (d->shortcuts.contains(action)) {
59 return d->shortcuts.values(action);
60 }
61
63}

References d, and KisInputProfile::Private::shortcuts.

Member Data Documentation

◆ d

Private* const KisInputProfile::d
private

Definition at line 80 of file kis_input_profile.h.


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