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

The UserInputTagAction class defines an action with user text input that sends a signal with a simple QString. More...

#include <TagActions.h>

+ Inheritance diagram for UserInputTagAction:

Signals

void triggered (const QString &newTagName)
 

Public Member Functions

 UserInputTagAction (QObject *parent)
 
 ~UserInputTagAction () override
 
- Public Member Functions inherited from LineEditAction
bool closeParentOnTrigger ()
 
void setCloseParentOnTrigger (bool closeParent)
 
void setIcon (const QIcon &icon)
 
void setPlaceholderText (const QString &clickMessage)
 
void setText (const QString &text)
 
void setVisible (bool showAction)
 
 ~LineEditAction () override
 

Protected Slots

void onTriggered () override
 
- Protected Slots inherited from LineEditAction
virtual void onTriggered ()
 onTriggered defines additional behaviour for the action
 
void slotActionTriggered ()
 slotActionTriggered defines all behaviour expressed when the widget is triggered
 
QString userText ()
 userText getter for the text inside the edit box
 

Additional Inherited Members

- Protected Member Functions inherited from LineEditAction
 LineEditAction (QObject *parent)
 

Detailed Description

The UserInputTagAction class defines an action with user text input that sends a signal with a simple QString.

It inherits all behaviour from LineEditAction. When triggered, it sends a signal with the content of the edit box.

Usages:

  • Create a new tag
  • Rename a current tag (the responsibility to know which tag is current depends on the external widget like KisTagChooserWidget)

Definition at line 130 of file TagActions.h.

Constructor & Destructor Documentation

◆ UserInputTagAction()

UserInputTagAction::UserInputTagAction ( QObject * parent)
explicit

Definition at line 135 of file TagActions.cpp.

136 : LineEditAction(parent)
137{
138 setIcon(koIcon("document-new"));
139 setPlaceholderText(i18n("New tag"));
141}
void setPlaceholderText(const QString &clickMessage)
LineEditAction(QObject *parent)
void setIcon(const QIcon &icon)
void setCloseParentOnTrigger(bool closeParent)
#define koIcon(name)
Use these macros for icons without any issues.
Definition kis_icon.h:25

References koIcon, LineEditAction::setCloseParentOnTrigger(), LineEditAction::setIcon(), and LineEditAction::setPlaceholderText().

◆ ~UserInputTagAction()

UserInputTagAction::~UserInputTagAction ( )
override

Definition at line 143 of file TagActions.cpp.

144{
145}

Member Function Documentation

◆ onTriggered

void UserInputTagAction::onTriggered ( )
overrideprotectedslot

Definition at line 147 of file TagActions.cpp.

148{
149 Q_EMIT triggered(userText());
150}
QString userText()
userText getter for the text inside the edit box
void triggered(const QString &newTagName)

References triggered(), and LineEditAction::userText().

◆ triggered

void UserInputTagAction::triggered ( const QString & newTagName)
signal

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