Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathToolFactory.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#include "KoPathToolFactory.h"
8#include "KoPathTool.h"
9#include "KoPathShape.h"
10#include <kis_action_registry.h>
11
12#include <KoIcon.h>
13#include <klocalizedstring.h>
14
16 : KoToolFactoryBase("PathTool")
17{
18 setToolTip(i18n("Edit Shapes Tool"));
20 setIconName(koIconNameCStr("shape_handling"));
21 setPriority(2);
22 setActivationShapeId("flake/always,KoPathShape");
23}
24
28
33
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()
QList< QAction * > createActionsImpl() override
createActionsImpl should be reimplemented if the tool needs any actions. The actions should have a va...
KoToolBase * createTool(KoCanvasBase *canvas) override
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 Main
Tools that only work on vector shapes.
KisCanvas2 * canvas