Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/wintab/drawpile_tablettester/tablettest.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Drawpile - a collaborative drawing program. | ||||
3 | | ||||
4 | Copyright (C) 2017 Calle Laakkonen | ||||
5 | | ||||
6 | Drawpile is free software: you can redistribute it and/or modify | ||||
7 | it under the terms of the GNU General Public License as published by | ||||
8 | the Free Software Foundation, either version 3 of the License, or | ||||
9 | (at your option) any later version. | ||||
10 | | ||||
11 | Drawpile is distributed in the hope that it will be useful, | ||||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | GNU General Public License for more details. | ||||
15 | | ||||
16 | You should have received a copy of the GNU General Public License | ||||
17 | along with Drawpile. If not, see <http://www.gnu.org/licenses/>. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef TABLETTEST_WIDGET_H | ||||
21 | #define TABLETTEST_WIDGET_H | ||||
22 | | ||||
23 | #include <QWidget> | ||||
24 | | ||||
25 | class TabletTester : public QWidget { | ||||
26 | Q_OBJECT | ||||
27 | public: | ||||
28 | TabletTester(QWidget *parent=nullptr); | ||||
29 | | ||||
30 | public Q_SLOTS: | ||||
31 | void clear(); | ||||
32 | | ||||
33 | Q_SIGNALS: | ||||
34 | void eventReport(const QString &msg); | ||||
35 | | ||||
36 | protected: | ||||
37 | void paintEvent(QPaintEvent *e) override; | ||||
38 | void mousePressEvent(QMouseEvent *e) override; | ||||
39 | void mouseMoveEvent(QMouseEvent *e) override; | ||||
40 | void mouseReleaseEvent(QMouseEvent *e) override; | ||||
41 | void tabletEvent(QTabletEvent *e) override; | ||||
42 | | ||||
43 | private: | ||||
44 | QPolygon m_mousePath; | ||||
45 | QPolygon m_tabletPath; | ||||
46 | | ||||
47 | bool m_mouseDown; | ||||
48 | bool m_tabletDown; | ||||
49 | }; | ||||
50 | | ||||
51 | #endif |