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

#include <kis_tool_brush.h>

+ Inheritance diagram for KisToolBrushFactory:

Public Member Functions

QList< QAction * > createActionsImpl () override
 createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a valid objectName().
 
KoToolBasecreateTool (KoCanvasBase *canvas) override
 
 KisToolBrushFactory ()
 
 KisToolBrushFactory (const QString &id)
 
void showFloatingMessage ()
 
 ~KisToolBrushFactory () override
 
- Public Member Functions inherited from KisToolPaintFactoryBase
 KisToolPaintFactoryBase (const QString &id)
 
 ~KisToolPaintFactoryBase () override
 
- Public Member Functions inherited from KoToolFactoryBase
QString activationShapeId () const
 
QList< QAction * > createActions (KisKActionCollection *actionCollection)
 
QString iconName () const
 
QString id () const
 
 KoToolFactoryBase (const QString &id)
 
int priority () const
 
 Private (const QString &i)
 
QString section () const
 
QKeySequence shortcut () const
 
QString toolTip () const
 
virtual ~KoToolFactoryBase ()
 

Additional Inherited Members

- Public Attributes inherited from KoToolFactoryBase
QString activationId
 
QString iconName
 
const QString id
 
int priority
 
QString section
 
QKeySequence shortcut
 
QString tooltip
 
- Protected Member Functions inherited from KisToolPaintFactoryBase
QList< QAction * > createActionsImpl () override
 createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a valid objectName().
 
- Protected Member Functions inherited from KoToolFactoryBase
void setActivationShapeId (const QString &activationShapeId)
 
void setIconName (const char *iconName)
 
void setIconName (const QString &iconName)
 
void setPriority (int newPriority)
 
void setSection (const QString &section)
 
void setShortcut (const QKeySequence &shortcut)
 
void setToolTip (const QString &tooltip)
 

Detailed Description

Definition at line 139 of file kis_tool_brush.h.

Constructor & Destructor Documentation

◆ KisToolBrushFactory() [1/2]

KisToolBrushFactory::KisToolBrushFactory ( )
inline

Definition at line 143 of file kis_tool_brush.h.

144 : KisToolPaintFactoryBase("KritaShape/KisToolBrush") {
145
146 setToolTip(i18n("Freehand Brush Tool"));
147
148 // Temporarily
150 setIconName(koIconNameCStr("krita_tool_freehand"));
151 setShortcut(QKeySequence(Qt::Key_B));
152 setPriority(0);
154 }
KisToolPaintFactoryBase(const QString &id)
void setShortcut(const QKeySequence &shortcut)
void setSection(const QString &section)
void setActivationShapeId(const QString &activationShapeId)
void setIconName(const char *iconName)
void setToolTip(const QString &tooltip)
void setPriority(int newPriority)
#define koIconNameCStr(name)
Definition kis_icon.h:28
static const QString KRITA_TOOL_ACTIVATION_ID
Definition kis_tool.h:37
static const QString Shape
Freehand and shapes like ellipses and lines.

References koIconNameCStr, KRITA_TOOL_ACTIVATION_ID, KoToolFactoryBase::setActivationShapeId(), KoToolFactoryBase::setIconName(), KoToolFactoryBase::setPriority(), KoToolFactoryBase::setSection(), KoToolFactoryBase::setShortcut(), KoToolFactoryBase::setToolTip(), and ToolBoxSection::Shape.

◆ KisToolBrushFactory() [2/2]

KisToolBrushFactory::KisToolBrushFactory ( const QString & id)
inline

Definition at line 156 of file kis_tool_brush.h.

158 {
159 }

◆ ~KisToolBrushFactory()

KisToolBrushFactory::~KisToolBrushFactory ( )
inlineoverride

Definition at line 161 of file kis_tool_brush.h.

161{}

Member Function Documentation

◆ createActionsImpl()

QList< QAction * > KisToolBrushFactory::createActionsImpl ( )
overridevirtual

createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a valid objectName().

Returns
the list of actions this tool wishes to be available.

Reimplemented from KoToolFactoryBase.

Definition at line 604 of file kis_tool_brush.cc.

605{
607
609
610 actions << actionRegistry->makeQAction("set_no_brush_smoothing", this);
611 actions << actionRegistry->makeQAction("set_simple_brush_smoothing", this);
612 actions << actionRegistry->makeQAction("set_weighted_brush_smoothing", this);
613 actions << actionRegistry->makeQAction("set_stabilizer_brush_smoothing", this);
614 actions << actionRegistry->makeQAction("set_pixel_perfect_smoothing", this);
615 actions << actionRegistry->makeQAction("toggle_assistant", this);
616
617 return actions;
618
619}
QAction * makeQAction(const QString &name, QObject *parent=0)
static KisActionRegistry * instance()
QList< QAction * > createActionsImpl() override
createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a va...

References KisToolPaintFactoryBase::createActionsImpl(), KisActionRegistry::instance(), and KisActionRegistry::makeQAction().

◆ createTool()

KoToolBase * KisToolBrushFactory::createTool ( KoCanvasBase * canvas)
inlineoverridevirtual

Instantiate a new tool

Parameters
canvasthe canvas that the new tool will work on. Should be passed to the constructor of the tool.
Returns
a new KoToolBase instance, or zero if the tool doesn't want to show up.

Implements KoToolFactoryBase.

Reimplemented in KisToolMultiBrushFactory.

Definition at line 163 of file kis_tool_brush.h.

163 {
164 return new KisToolBrush(canvas);
165 }
KisCanvas2 * canvas

References Private::canvas.

◆ showFloatingMessage()

void KisToolBrushFactory::showFloatingMessage ( )

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