summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtabletevent/tabletwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qtabletevent/tabletwidget.h')
-rw-r--r--tests/manual/qtabletevent/tabletwidget.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/manual/qtabletevent/tabletwidget.h b/tests/manual/qtabletevent/tabletwidget.h
new file mode 100644
index 0000000..b0efef2
--- /dev/null
+++ b/tests/manual/qtabletevent/tabletwidget.h
@@ -0,0 +1,32 @@
+#ifndef TABLETWIDGET_H
+#define TABLETWIDGET_H
+
+#include <QWidget>
+#include <QTabletEvent>
+
+// a widget showing the information of the last tablet event
+class TabletWidget : public QWidget
+{
+public:
+ TabletWidget();
+protected:
+ bool eventFilter(QObject *obj, QEvent *ev);
+ void tabletEvent(QTabletEvent *event);
+ void paintEvent(QPaintEvent *event);
+private:
+ void resetAttributes() {
+ mType = mDev = mPointerType = mXT = mYT = mZ = 0;
+ mPress = mTangential = mRot = 0.0;
+ mPos = mGPos = QPoint();
+ mHiResGlobalPos = QPointF();
+ mUnique = 0;
+ }
+ int mType;
+ QPoint mPos, mGPos;
+ QPointF mHiResGlobalPos;
+ int mDev, mPointerType, mXT, mYT, mZ;
+ qreal mPress, mTangential, mRot;
+ qint64 mUnique;
+};
+
+#endif // TABLETWIDGET_H