Krita Source Code Documentation
Loading...
Searching...
No Matches
KisToolKnife.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Agata Cacko
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_TOOL_KNIFE_H_
8#define KIS_TOOL_KNIFE_H_
9
10#include <QScopedPointer>
11#include <QPainterPath>
12
13#include "KoInteractionTool.h"
14
16
18#include <kis_icon.h>
19#include <QKeySequence>
20#include <klocalizedstring.h>
21
22#include <kconfig.h>
23#include <kconfiggroup.h>
24#include <KoIcon.h>
25
27class KoCanvasBase;
30
31
33{
34 Q_OBJECT
35public:
37 ~KisToolKnife() override;
38
39 QWidget * createOptionWidget() override;
40
41 void paint(QPainter &painter, const KoViewConverter &converter) override;
42
43protected Q_SLOTS:
44
45public Q_SLOTS:
46 void activate(const QSet<KoShape*> &shapes) override;
47 void deactivate() override;
49 void mouseMoveEvent(KoPointerEvent *event) override;
50 void mouseReleaseEvent(KoPointerEvent *event) override;
51
53
54 bool isValidForCurrentLayer() const;
55private:
56 //friend class KisToolKnifeOptionsWidget;
57private:
58 struct Private;
59 const QScopedPointer<Private> m_d;
60};
61
62
64{
65
66public:
68 : KisToolPaintFactoryBase("KritaShape/KisToolKnife")
69 {
70
71 setToolTip(i18n("Comic Panel Editing Tool"));
72
74 setIconName(koIconNameCStr("tool_comic_panel"));
75 setPriority(7);
76 setActivationShapeId("flake/always,KoPathShape");
77 }
78
80
82 {
83 return new KisToolKnife(canvas);
84 }
85
86};
87
88
89#endif // KIS_TOOL_KNIFE_H_
A container for a set of QAction objects.
KoToolBase * createTool(KoCanvasBase *canvas) override
~KisToolKnifeFactory() override
void mouseMoveEvent(KoPointerEvent *event) override
KisToolKnife(KoCanvasBase *canvas)
~KisToolKnife() override
void mousePressEvent(KoPointerEvent *event)
void mouseReleaseEvent(KoPointerEvent *event) override
void deactivate() override
void paint(QPainter &painter, const KoViewConverter &converter) override
const QScopedPointer< Private > m_d
KoInteractionStrategy * createStrategy(KoPointerEvent *event) override
QWidget * createOptionWidget() override
void activate(const QSet< KoShape * > &shapes) override
bool isValidForCurrentLayer() const
KoCanvasBase * canvas() const
Returns the canvas the tool is working on.
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