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

#include <KoToolManager.h>

+ Inheritance diagram for KoToolAction:

Public Slots

void trigger ()
 Request the activation of the tool.
 

Signals

void changed ()
 Emitted when a property changes (shortcut ATM)
 

Public Member Functions

int buttonGroupId () const
 A unique ID for this tool as passed by changedTool(), >= 0.
 
QString iconName () const
 The icon name of the tool.
 
QString iconText () const
 The icontext of the tool.
 
QString id () const
 The id of the tool.
 
 KoToolAction (KoToolFactoryBase *toolFactory, KoToolManager *toolManager)
 
int priority () const
 Lower number (higher priority) means coming first in the section.
 
QString section () const
 The section the tool wants to be in.
 
QKeySequence shortcut () const
 The shortcut to activate the tool.
 
KoToolFactoryBase * toolFactory () const
 Factory to create new tool object instances.
 
QString toolName () const
 The localized tool name.
 
QString toolTip () const
 The tooltip of the tool.
 
QString visibilityCode () const
 This tool should become visible when we Q_EMIT this string in toolCodesSelected()
 
 ~KoToolAction () override
 

Public Attributes

KoToolFactoryBase * toolFactory
 
KoToolManager * toolManager
 

Private Attributes

Private *const d
 
- Private Attributes inherited from Private
KisCanvas2 * canvas
 
int displayedFrame
 
int intendedFrame
 

Additional Inherited Members

- Private Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Detailed Description

This class serves as a QAction-like control object for activation of a tool.

It allows to implement a custom UI to control the activation of tools. See KoToolBox & KoModeBox in the kowidgets library.

KoToolAction objects are owned by the KoToolManager and live until the end of its lifetime.

Definition at line 41 of file KoToolManager.h.

Constructor & Destructor Documentation

◆ KoToolAction()

KoToolAction::KoToolAction ( KoToolFactoryBase * toolFactory,
KoToolManager * toolManager )

Definition at line 24 of file KoToolManager_p.cpp.

25 : d(new Private)
26{
27 d->toolFactory = toolFactory;
28 d->toolManager = toolManager;
29}
KoToolManager * toolManager
Private *const d
KoToolFactoryBase * toolFactory

References d, toolFactory, and toolManager.

◆ ~KoToolAction()

KoToolAction::~KoToolAction ( )
override

Definition at line 31 of file KoToolManager_p.cpp.

32{
33 delete d;
34}

References d.

Member Function Documentation

◆ buttonGroupId()

int KoToolAction::buttonGroupId ( ) const

A unique ID for this tool as passed by changedTool(), >= 0.

◆ changed

void KoToolAction::changed ( )
signal

Emitted when a property changes (shortcut ATM)

◆ iconName()

QString KoToolAction::iconName ( ) const

The icon name of the tool.

Definition at line 63 of file KoToolManager_p.cpp.

64{
65 return d->toolFactory->iconName();
66}

References d.

◆ iconText()

QString KoToolAction::iconText ( ) const

The icontext of the tool.

Definition at line 42 of file KoToolManager_p.cpp.

43{
44 // There is no specific iconText in KoToolFactoryBase
45 return d->toolFactory->toolTip();
46}

References d.

◆ id()

QString KoToolAction::id ( ) const

The id of the tool.

Definition at line 58 of file KoToolManager_p.cpp.

59{
60 return d->toolFactory->id();
61}

References d.

◆ priority()

int KoToolAction::priority ( ) const

Lower number (higher priority) means coming first in the section.

Definition at line 79 of file KoToolManager_p.cpp.

80{
81 return d->toolFactory->priority();
82}

References d.

◆ section()

QString KoToolAction::section ( ) const

The section the tool wants to be in.

Definition at line 74 of file KoToolManager_p.cpp.

75{
76 return d->toolFactory->section();
77}

References d.

◆ shortcut()

QKeySequence KoToolAction::shortcut ( ) const

The shortcut to activate the tool.

Definition at line 68 of file KoToolManager_p.cpp.

69{
70 return d->toolFactory->shortcut();
71}

References d.

◆ toolFactory()

KoToolFactoryBase * KoToolAction::toolFactory ( ) const

Factory to create new tool object instances.

◆ toolName()

QString KoToolAction::toolName ( ) const

The localized tool name.

Definition at line 53 of file KoToolManager_p.cpp.

54{
55 return d->toolFactory->toolName();
56}

References d.

◆ toolTip()

QString KoToolAction::toolTip ( ) const

The tooltip of the tool.

Definition at line 48 of file KoToolManager_p.cpp.

49{
50 return d->toolFactory->toolTip();
51}

References d.

◆ trigger

void KoToolAction::trigger ( )
slot

Request the activation of the tool.

Definition at line 36 of file KoToolManager_p.cpp.

37{
38 d->toolManager->switchToolRequested(id());
39}

References d.

◆ visibilityCode()

QString KoToolAction::visibilityCode ( ) const

This tool should become visible when we Q_EMIT this string in toolCodesSelected()

Definition at line 84 of file KoToolManager_p.cpp.

85{
86 return d->toolFactory->activationShapeId();
87}

References d.

Member Data Documentation

◆ d

Private* const KoToolAction::d
private

Definition at line 71 of file KoToolManager.h.

◆ toolFactory

KoToolFactoryBase * KoToolAction::toolFactory

Definition at line 20 of file KoToolManager_p.cpp.

◆ toolManager

KoToolManager* KoToolAction::toolManager

Definition at line 21 of file KoToolManager_p.cpp.


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