Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAngleGauge.h
Go to the documentation of this file.
1/*
2 * KDE. Krita Project.
3 *
4 * SPDX-FileCopyrightText: 2020 Deif Lou <ginoba@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KISANGLEGAUGE_H
10#define KISANGLEGAUGE_H
11
12#include <QWidget>
13#include <QScopedPointer>
14
15#include "kritawidgets_export.h"
16
20class KRITAWIDGETS_EXPORT KisAngleGauge : public QWidget
21{
22 Q_OBJECT
23
24public:
26 {
28 IncreasingDirection_Clockwise
29 };
30
35 explicit KisAngleGauge(QWidget *parent = 0);
37
43 qreal angle() const;
52 qreal snapAngle() const;
60 qreal resetAngle() const;
67 IncreasingDirection increasingDirection() const;
68
74 void setSnapAngle(qreal newSnapAngle);
80 void setResetAngle(qreal newResetAngle);
87 void setIncreasingDirection(IncreasingDirection newIncreasingDirection);
88
89public Q_SLOTS:
95 void setAngle(qreal newAngle);
101 void reset();
102
103Q_SIGNALS:
108 void angleChanged(qreal angle);
109
110protected:
111 void paintEvent(QPaintEvent *e) override;
112 void mousePressEvent(QMouseEvent *e) override;
113 void mouseReleaseEvent(QMouseEvent *e) override;
114 void mouseMoveEvent(QMouseEvent *e) override;
115 void mouseDoubleClickEvent(QMouseEvent *e) override;
116 void wheelEvent(QWheelEvent *e) override;
117 void keyPressEvent(QKeyEvent *e) override;
118#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
119 void enterEvent(QEvent *e) override;
120#else
121 void enterEvent(QEnterEvent *e) override;
122#endif
123 void leaveEvent(QEvent *e) override;
124private:
125 struct Private;
126 const QScopedPointer<Private> m_d;
127};
128
129#endif
const QList< QString > IncreasingDirection
A circular widget that allows to choose an angle.
void angleChanged(qreal angle)
Signal emitted when the angle has changed.
const QScopedPointer< Private > m_d
@ IncreasingDirection_CounterClockwise