diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-02-01 07:56:23 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-02-23 05:27:33 +0000 |
commit | 32b278b13bf0e2ef7ee4fdc8edfdfccdf190d4cb (patch) | |
tree | 079168c05cfe5e667631d6f34c9db7e79b5543e5 /src/3rdparty/sqlite/sqlite3.h | |
parent | 81ba148fc9ba9b71e261d46c500290690ee2ec63 (diff) |
Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use
QGuiApplicationPrivate::lastCursorPosition is initialized with qInf();
so before Qt has seen a mouse move event, attempting to convert to
QPoint is an error. It's best to have one place where we do the qIsInf()
check rather than several (and otherwise prefer using the QPointF as-is
rather than converting to QPoint at all).
Introduce a helper class that contains a QPointF, and provides a safe
conversion to QPoint, as well as simple accessors for clients using
QPointF.
Fixes: QTBUG-52472
Task-number: QTBUG-45045
Change-Id: I83fad1bfb658e03fa876344552f1d5bb751d9f81
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit c5792dcfd631abb4f9e2b92cd6e88d7e5c373406)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/3rdparty/sqlite/sqlite3.h')
0 files changed, 0 insertions, 0 deletions