Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_draggable_tool_button.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_DRAGGABLE_TOOL_BUTTON_H
8#define __KIS_DRAGGABLE_TOOL_BUTTON_H
9
10#include <QToolButton>
11
12
13class KisDraggableToolButton : public QToolButton
14{
15 Q_OBJECT
16public:
17 KisDraggableToolButton(QWidget *parent);
18 ~KisDraggableToolButton() override;
19
20 void mousePressEvent(QMouseEvent *e) override;
21 void mouseMoveEvent(QMouseEvent *e) override;
22
23 void beginDrag(const QPoint &pos);
24 int continueDrag(const QPoint &pos);
25 int movementDelta(const QPoint &pos);
26
27private:
28 qreal tangent();
29
30Q_SIGNALS:
31 void offsetChanged(int offset);
32 void valueChanged(int delta);
33
34private:
35 Qt::Orientation m_orientation;
38};
39
40#endif /* __KIS_DRAGGABLE_TOOL_BUTTON_H */
int continueDrag(const QPoint &pos)
int movementDelta(const QPoint &pos)
void valueChanged(int delta)
void mousePressEvent(QMouseEvent *e) override
void mouseMoveEvent(QMouseEvent *e) override
void offsetChanged(int offset)
void beginDrag(const QPoint &pos)