Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_rectangle.h
Go to the documentation of this file.
1/*
2 * kis_tool_rectangle.h - part of KImageShop^WKrayon^WKrita
3 *
4 * SPDX-FileCopyrightText: 1999 Michael Koch <koch@kde.org>
5 * SPDX-FileCopyrightText: 2002 Patrick Julien <freak@codepimps.org>
6 * SPDX-FileCopyrightText: 2004 Boudewijn Rempt <boud@valdyas.org>
7 * SPDX-FileCopyrightText: 2004 Clarence Dang <dang@kde.org>
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __KIS_TOOL_RECTANGLE_H__
13#define __KIS_TOOL_RECTANGLE_H__
14
15#include "kis_tool_shape.h"
16#include "kis_types.h"
20#include <kis_icon.h>
21
22
23class QRect;
24
25class KoCanvasBase;
26
28{
29 Q_OBJECT
30
31public:
33 ~KisToolRectangle() override;
34
35 bool supportsPaintingAssistants() const override;
36
37protected:
38 void finishRect(const QRectF& rect, qreal roundCornersX, qreal roundCornersY) override;
39
40protected Q_SLOTS:
41 void resetCursorStyle() override;
42};
43
45{
46
47public:
49 : KisToolPaintFactoryBase("KritaShape/KisToolRectangle") {
50 setToolTip(i18n("Rectangle Tool"));
51
54 setIconName(koIconNameCStr("krita_tool_rectangle"));
55 //setShortcut( Qt::Key_F6 );
56 setPriority(2);
57 }
58
60
62 return new KisToolRectangle(canvas);
63 }
64
65};
66
67
68#endif // __KIS_TOOL_RECTANGLE_H__
69
KoToolBase * createTool(KoCanvasBase *canvas) override
void resetCursorStyle() override
KisToolRectangle(KoCanvasBase *canvas)
void finishRect(const QRectF &rect, qreal roundCornersX, qreal roundCornersY) override
bool supportsPaintingAssistants() const 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 KRITA_TOOL_ACTIVATION_ID
Definition kis_tool.h:37
static const QString Shape
Freehand and shapes like ellipses and lines.
KisCanvas2 * canvas