Krita Source Code Documentation
Loading...
Searching...
No Matches
KisClickableGLImageWidget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISCLICKABLEGLIMAGEWIDGET_H
8#define KISCLICKABLEGLIMAGEWIDGET_H
9
10#include <KisGLImageWidget.h>
11#include <QScopedPointer>
12
13
15{
16 Q_OBJECT
17public:
19 virtual void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity) = 0;
21 };
22
24 void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity) override;
25 };
26
28 void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity) override;
29 };
30
31public:
32 KisClickableGLImageWidget(QWidget *parent = nullptr);
34 QWidget *parent = nullptr);
36
38 void setUseHandleOpacity(bool value);
39
40 QPointF normalizedPos() const;
41 void setNormalizedPos(const QPointF &pos, bool update = true);
42
43 void paintEvent(QPaintEvent *event) override;
44
45 void mousePressEvent(QMouseEvent *event) override;
46 void mouseReleaseEvent(QMouseEvent *event) override;
47 void mouseMoveEvent(QMouseEvent *event) override;
48
49Q_SIGNALS:
50 void selected(const QPointF &normalizedPos);
51
52private:
53 QPointF normalizePoint(const QPointF &pos) const;
54
55private:
57 QScopedPointer<HandlePaintingStrategy> m_handleStrategy;
58 bool m_useHandleOpacity = true;
59};
60
61#endif // KISCLICKABLEGLIMAGEWIDGET_H
float value(const T *src, size_t ch)
const Params2D p
void setHandlePaintingStrategy(HandlePaintingStrategy *strategy)
void mouseMoveEvent(QMouseEvent *event) override
QPointF normalizePoint(const QPointF &pos) const
void setNormalizedPos(const QPointF &pos, bool update=true)
KisClickableGLImageWidget(QWidget *parent=nullptr)
void mousePressEvent(QMouseEvent *event) override
void paintEvent(QPaintEvent *event) override
QScopedPointer< HandlePaintingStrategy > m_handleStrategy
void selected(const QPointF &normalizedPos)
void mouseReleaseEvent(QMouseEvent *event) override
void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity) override
virtual void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity)=0
void drawHandle(QPainter *p, const QPointF &normalizedPoint, const QRect &rect, bool useOpacity) override