summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-12-06 14:48:44 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2016-12-09 13:44:55 +0000
commit201f89f463ae82fe8e9239d7312907062e9a8d15 (patch)
treebff62d570082aa6e096123a85399517e9acc5973 /src/gui/kernel/qevent_p.h
parenta30fca8711374edfefb2085aaa64ac98971b7c40 (diff)
QTouchEvent::TouchPoint: replace ellipse diameters with QSizeF
It makes assignment a bit more succinct and efficient since they are usually set together. Since we store the diameters and the points separately, we no longer need to worry about updating rects by moving their centers. QGuiApplication and QApplication don't need to alter the diameters: they are set once when the event is constructed. Also fix the initialization of pressure and rotation: 418b6f6899ee414aff29c91a4ae17eed8791a617 did it by casting a double to qreal, whereas a plain integer constant will be auto-converted by the compiler anyway. Change-Id: Ib9956d2def21278b8ae042147d917da156e77e52 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent_p.h')
-rw-r--r--src/gui/kernel/qevent_p.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index a8b4d520d4..f67284eebb 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -65,10 +65,9 @@ public:
: ref(1),
id(id),
state(Qt::TouchPointReleased),
- pressure(qreal(-1.)),
- rotation(qreal(0.)),
- verticalDiameter(0),
- horizontalDiameter(0)
+ pressure(-1),
+ rotation(0),
+ ellipseDiameters(0, 0)
{ }
inline QTouchEventTouchPointPrivate *detach()
@@ -89,8 +88,7 @@ public:
lastPos, lastScenePos, lastScreenPos, lastNormalizedPos;
qreal pressure;
qreal rotation;
- qreal verticalDiameter;
- qreal horizontalDiameter;
+ QSizeF ellipseDiameters;
QVector2D velocity;
QTouchEvent::TouchPoint::InfoFlags flags;
QVector<QPointF> rawScreenPositions;