summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtabletevent/tabletwidget.h
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-10 17:23:04 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-10 17:25:19 (GMT)
commit4096911423fcd52c59d83f153b3a83ae99312a70 (patch)
tree226c499a2eeefe61195b6274bba5899b5cf0bf93 /tests/manual/qtabletevent/tabletwidget.h
parentf9605d3f396043e5b893470acaeb4c726361e9dc (diff)
downloadQt-4096911423fcd52c59d83f153b3a83ae99312a70.zip
Qt-4096911423fcd52c59d83f153b3a83ae99312a70.tar.gz
Qt-4096911423fcd52c59d83f153b3a83ae99312a70.tar.bz2
Add a Widget for manual testing of the tablet API
The QTabletWidget shows the informations provided by the last QTabletEvent.
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