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

The SimpleExistingTagAction class defines an action that holds a resource and a tag. More...

#include <TagActions.h>

+ Inheritance diagram for SimpleExistingTagAction:

Signals

void triggered (KisTagSP tag, KoResourceSP resource)
 

Public Member Functions

 SimpleExistingTagAction (KoResourceSP resource, KisTagSP tag, QObject *parent=0)
 
 ~SimpleExistingTagAction () override
 

Protected Slots

void onTriggered ()
 

Private Attributes

KoResourceSP m_resource
 m_resource resource associated with the action
 
KisTagSP m_tag
 m_tag tag associated with the action
 

Detailed Description

The SimpleExistingTagAction class defines an action that holds a resource and a tag.

This is mostly used in ContextMenu for the context menu actions displaying tags to tag or untag specific resource with a specific tag.

Definition at line 30 of file TagActions.h.

Constructor & Destructor Documentation

◆ SimpleExistingTagAction()

SimpleExistingTagAction::SimpleExistingTagAction ( KoResourceSP resource,
KisTagSP tag,
QObject * parent = 0 )
explicit

Definition at line 24 of file TagActions.cpp.

25 : QAction(parent)
26 , m_resource(resource)
27 , m_tag(tag)
28{
29 if (tag) {
30 setText(tag->name());
31 }
32 connect (this, SIGNAL(triggered()),
33 this, SLOT(onTriggered()));
34}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisTagSP m_tag
m_tag tag associated with the action
Definition TagActions.h:51
KoResourceSP m_resource
m_resource resource associated with the action
Definition TagActions.h:47
void triggered(KisTagSP tag, KoResourceSP resource)
void setText(QSpinBox *spinBox, const QStringView textTemplate)

References connect(), onTriggered(), and triggered().

◆ ~SimpleExistingTagAction()

SimpleExistingTagAction::~SimpleExistingTagAction ( )
override

Definition at line 36 of file TagActions.cpp.

37{
38}

Member Function Documentation

◆ onTriggered

void SimpleExistingTagAction::onTriggered ( )
protectedslot

Definition at line 40 of file TagActions.cpp.

41{
42 if (!m_tag) return;
43 Q_EMIT triggered(m_tag, m_resource);
44}

References m_resource, m_tag, and triggered().

◆ triggered

void SimpleExistingTagAction::triggered ( KisTagSP tag,
KoResourceSP resource )
signal

Member Data Documentation

◆ m_resource

KoResourceSP SimpleExistingTagAction::m_resource
private

m_resource resource associated with the action

Definition at line 47 of file TagActions.h.

◆ m_tag

KisTagSP SimpleExistingTagAction::m_tag
private

m_tag tag associated with the action

Definition at line 51 of file TagActions.h.


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