File indexing completed on 2025-04-27 04:09:17
0001 /* 0002 Drawpile - a collaborative drawing program. 0003 0004 SPDX-FileCopyrightText: 2017 Calle Laakkonen 0005 0006 SPDX-License-Identifier: GPL-3.0-or-later 0007 */ 0008 0009 #ifndef TABLETTEST_WIDGET_H 0010 #define TABLETTEST_WIDGET_H 0011 0012 #include <QWidget> 0013 #include <kis_speed_smoother.h> 0014 0015 class TabletTester : public QWidget { 0016 Q_OBJECT 0017 public: 0018 TabletTester(QWidget *parent=nullptr); 0019 0020 public Q_SLOTS: 0021 void clear(); 0022 0023 Q_SIGNALS: 0024 void eventReport(const QString &msg); 0025 0026 protected: 0027 void paintEvent(QPaintEvent *e) override; 0028 void mousePressEvent(QMouseEvent *e) override; 0029 void mouseMoveEvent(QMouseEvent *e) override; 0030 void mouseReleaseEvent(QMouseEvent *e) override; 0031 void tabletEvent(QTabletEvent *e) override; 0032 0033 QSize sizeHint() const override; 0034 0035 private: 0036 QPolygon m_mousePath; 0037 QPolygon m_tabletPath; 0038 0039 bool m_mouseDown; 0040 bool m_tabletDown; 0041 KisSpeedSmoother m_tabletSpeedSmoother; 0042 KisSpeedSmoother m_mouseSpeedSmoother; 0043 }; 0044 0045 #endif