diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-03 10:29:24 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-03 10:29:24 (GMT) |
commit | b93e3a34402aadc9d313fe64e18d7373cd50612c (patch) | |
tree | 30c74be85c3ba869998ffb12cbdbf59c724ad46d /examples | |
parent | c8226762c4fe9ca4c98114a4bf6d88adc44bc2fb (diff) | |
download | Qt-b93e3a34402aadc9d313fe64e18d7373cd50612c.zip Qt-b93e3a34402aadc9d313fe64e18d7373cd50612c.tar.gz Qt-b93e3a34402aadc9d313fe64e18d7373cd50612c.tar.bz2 |
Add support for touch point contact area
Add QTouchEvent::TouchPoint::area() and implement support for it on Windows
Diffstat (limited to 'examples')
-rw-r--r-- | examples/multitouch/fingerpaint/scribblearea.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/multitouch/fingerpaint/scribblearea.cpp b/examples/multitouch/fingerpaint/scribblearea.cpp index a042fe7..ffff9bb 100644 --- a/examples/multitouch/fingerpaint/scribblearea.cpp +++ b/examples/multitouch/fingerpaint/scribblearea.cpp @@ -184,8 +184,12 @@ bool ScribbleArea::event(QEvent *event) continue; default: { - int diameter = int(50 * touchPoint->pressure()); - QRectF rectF(0, 0, diameter, diameter); + QSizeF area = touchPoint->area(); + if (area.isEmpty()) { + qreal diameter = qreal(50) * touchPoint->pressure(); + area = QSizeF(diameter, diameter); + } + QRectF rectF(QPointF(), area); rectF.moveCenter(touchPoint->pos()); QRect rect = rectF.toRect(); |