summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-09-22 00:02:16 -0700
committerLars Knoll <lars.knoll@qt.io>2017-10-29 10:13:23 +0000
commitfb5976038162d93d60c7f76376bbb4df38e83ba9 (patch)
tree6ea5ee808422fe7dee70590dd5348961eda0d047 /src/gui/kernel/qevent.h
parent0e0f656f5031585c6b691d80057dfdc00bc48400 (diff)
Fix GCC -Wfloat-conversion warnings (available since GCC 4.9)
This warning used to be part of -Wconversion, but that generates too more noise than we're willing to fix now (like conversion from qint64 to int). The float conversion does trigger for conversion from double to float, as shown in all the QVectorND uses of float, but more importantly, it triggers on passing floats to ints. Change-Id: I69f37f9304f24709a823fffd14e69cfd33f75988 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r--src/gui/kernel/qevent.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index e6e7339b10..372b5f0896 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -205,10 +205,10 @@ public:
#ifndef QT_NO_INTEGER_EVENT_COORDINATES
inline QPoint pos() const { return p.toPoint(); }
inline QPoint globalPos() const { return g.toPoint(); }
- inline int x() const { return p.x(); }
- inline int y() const { return p.y(); }
- inline int globalX() const { return g.x(); }
- inline int globalY() const { return g.y(); }
+ inline int x() const { return int(p.x()); }
+ inline int y() const { return int(p.y()); }
+ inline int globalX() const { return int(g.x()); }
+ inline int globalY() const { return int(g.y()); }
#endif
inline const QPointF &posF() const { return p; }
inline const QPointF &globalPosF() const { return g; }