summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/tablet
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-02-17 13:32:01 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-02-23 10:42:42 +0000
commit6aaf8532222759226a9b406bfe6c57787236cbf1 (patch)
tree3fff923fc5d11a2554c647a367fd81a69de29a3e /examples/widgets/widgets/tablet
parentea615b421b76668332a3029ad31fa725b5bb9e58 (diff)
make TabletMove hover events conditional on QWidget::tabletTracking
This adds the tabletTracking property in the same way that mouseTracking already existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event to notify when it changes. So for widget applications it's an opt-in feature. QtQuick applications don't yet make use of tablet events, but when they do in the future, we don't yet have a mechanism to turn the move events off; it remains to be seen whether that will be necessary. [ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous to mouseTracking, which will enable TabletMove events while the stylus is hovering, even if no button is pressed. This allows applications to show feedback based on the other tablet event properties such as rotation and tilt. Task-number: QTBUG-26116 Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'examples/widgets/widgets/tablet')
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp
index ba797500e9..03e05e42f6 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.cpp
+++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp
@@ -67,6 +67,7 @@ TabletCanvas::TabletCanvas()
resize(500, 500);
initPixmap();
setAutoFillBackground(true);
+ setAttribute(Qt::WA_TabletTracking);
}
void TabletCanvas::initPixmap()