summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.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.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.h')
-rw-r--r--src/gui/kernel/qevent.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 982072c7d4..d7b7b636b2 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -870,8 +870,7 @@ public:
qreal pressure() const;
qreal rotation() const;
- qreal horizontalDiameter() const;
- qreal verticalDiameter() const;
+ QSizeF ellipseDiameters() const;
QVector2D velocity() const;
InfoFlags flags() const;
@@ -898,8 +897,7 @@ public:
void setScreenRect(const QRectF &screenRect); // deprecated
void setPressure(qreal pressure);
void setRotation(qreal angle);
- void setVerticalDiameter(qreal dia);
- void setHorizontalDiameter(qreal dia);
+ void setEllipseDiameters(const QSizeF &dia);
void setVelocity(const QVector2D &v);
void setFlags(InfoFlags flags);
void setRawScreenPositions(const QVector<QPointF> &positions);