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

Factory for the KoPathTool. More...

#include <KoPathToolFactory.h>

+ Inheritance diagram for KoPathToolFactory:

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
 
 KoPathToolFactory ()
 
 ~KoPathToolFactory () 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 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

Factory for the KoPathTool.

Definition at line 13 of file KoPathToolFactory.h.

Constructor & Destructor Documentation

◆ KoPathToolFactory()

KoPathToolFactory::KoPathToolFactory ( )

Definition at line 15 of file KoPathToolFactory.cpp.

16 : KoToolFactoryBase("PathTool")
17{
18 setToolTip(i18n("Edit Shapes Tool"));
20 setIconName(koIconNameCStr("shape_handling"));
21 setPriority(2);
22 setActivationShapeId("flake/always,KoPathShape");
23}
void setSection(const QString &section)
void setActivationShapeId(const QString &activationShapeId)
void setIconName(const char *iconName)
KoToolFactoryBase(const QString &id)
void setToolTip(const QString &tooltip)
void setPriority(int newPriority)
#define koIconNameCStr(name)
Definition kis_icon.h:28
static const QString Main
Tools that only work on vector shapes.

References koIconNameCStr, ToolBoxSection::Main, KoToolFactoryBase::setActivationShapeId(), KoToolFactoryBase::setIconName(), KoToolFactoryBase::setPriority(), KoToolFactoryBase::setSection(), and KoToolFactoryBase::setToolTip().

◆ ~KoPathToolFactory()

KoPathToolFactory::~KoPathToolFactory ( )
override

Definition at line 25 of file KoPathToolFactory.cpp.

26{
27}

Member Function Documentation

◆ createActionsImpl()

QList< QAction * > KoPathToolFactory::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 34 of file KoPathToolFactory.cpp.

35{
37 QList<QAction *> actions;
38 actions << actionRegistry->makeQAction("pathpoint-corner", this);
39 actions << actionRegistry->makeQAction("pathpoint-smooth", this);
40 actions << actionRegistry->makeQAction("pathpoint-symmetric", this);
41 actions << actionRegistry->makeQAction("pathpoint-curve", this);
42 actions << actionRegistry->makeQAction("pathpoint-line", this);
43 actions << actionRegistry->makeQAction("pathsegment-line", this);
44 actions << actionRegistry->makeQAction("pathsegment-curve", this);
45 actions << actionRegistry->makeQAction("pathpoint-insert", this);
46 actions << actionRegistry->makeQAction("pathpoint-remove", this);
47 actions << actionRegistry->makeQAction("path-break-point", this);
48 actions << actionRegistry->makeQAction("path-break-segment", this);
49 actions << actionRegistry->makeQAction("path-break-selection", this);
50 actions << actionRegistry->makeQAction("pathpoint-join", this);
51 actions << actionRegistry->makeQAction("pathpoint-merge", this);
52 actions << actionRegistry->makeQAction("convert-to-path", this);
53 return actions;
54}
QAction * makeQAction(const QString &name, QObject *parent=0)
static KisActionRegistry * instance()

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

◆ createTool()

KoToolBase * KoPathToolFactory::createTool ( KoCanvasBase * canvas)
overridevirtual

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.

Definition at line 29 of file KoPathToolFactory.cpp.

30{
31 return new KoPathTool(canvas);
32}
KisCanvas2 * canvas

References Private::canvas.


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