Use QLastCursorPosition to check for missing cursor position
After c5792dcfd631abb4f9e2b92cd6e88d7e5c373406 the last cursor position is reflected as a QPoint(std::numeric_limits<int>::max(), ...), and after 209a2145f94e99f99832c3a08cdf579d8f42ca55 as 1 << 23. Instead of hard coding the sentinel value, let's use QLastCursorPosition directly. Pick-to: 6.9 6.8 6.5 Change-Id: I24031f3cc800d2f0028eb95f4f8597019cc945c0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
4afd089612
commit
4ae41c225b
@ -195,7 +195,8 @@ void QBasicDrag::startDrag()
|
||||
QPoint pos;
|
||||
#ifndef QT_NO_CURSOR
|
||||
pos = QCursor::pos();
|
||||
if (pos.x() == int(qInf())) {
|
||||
static constexpr QGuiApplicationPrivate::QLastCursorPosition uninitializedCursorPosition;
|
||||
if (pos == uninitializedCursorPosition) {
|
||||
// ### fixme: no mouse pos registered. Get pos from touch...
|
||||
pos = QPoint();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user