QWindowsCursor: fix typo and change enum CursorState into enum class
Change-Id: I55b539da99254d3f7318193669c409552e429a6a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
c8178fd52e
commit
9941719a8d
@ -660,18 +660,18 @@ QPoint QWindowsCursor::mousePosition()
|
|||||||
return QPoint(p.x, p.y);
|
return QPoint(p.x, p.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWindowsCursor::CursorState QWindowsCursor::cursorState()
|
QWindowsCursor::State QWindowsCursor::cursorState()
|
||||||
{
|
{
|
||||||
enum { cursorShowing = 0x1, cursorSuppressed = 0x2 }; // Windows 8: CURSOR_SUPPRESSED
|
enum { cursorShowing = 0x1, cursorSuppressed = 0x2 }; // Windows 8: CURSOR_SUPPRESSED
|
||||||
CURSORINFO cursorInfo;
|
CURSORINFO cursorInfo;
|
||||||
cursorInfo.cbSize = sizeof(CURSORINFO);
|
cursorInfo.cbSize = sizeof(CURSORINFO);
|
||||||
if (GetCursorInfo(&cursorInfo)) {
|
if (GetCursorInfo(&cursorInfo)) {
|
||||||
if (cursorInfo.flags & CursorShowing)
|
if (cursorInfo.flags & cursorShowing)
|
||||||
return CursorShowing;
|
return State::Showing;
|
||||||
if (cursorInfo.flags & cursorSuppressed)
|
if (cursorInfo.flags & cursorSuppressed)
|
||||||
return CursorSuppressed;
|
return State::Suppressed;
|
||||||
}
|
}
|
||||||
return CursorHidden;
|
return State::Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint QWindowsCursor::pos() const
|
QPoint QWindowsCursor::pos() const
|
||||||
|
@ -89,10 +89,10 @@ typedef QSharedPointer<CursorHandle> CursorHandlePtr;
|
|||||||
class QWindowsCursor : public QPlatformCursor
|
class QWindowsCursor : public QPlatformCursor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum CursorState {
|
enum class State {
|
||||||
CursorShowing,
|
Showing,
|
||||||
CursorHidden,
|
Hidden,
|
||||||
CursorSuppressed // Cursor suppressed by touch interaction (Windows 8).
|
Suppressed // Cursor suppressed by touch interaction (Windows 8).
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PixmapCursor {
|
struct PixmapCursor {
|
||||||
@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = nullptr);
|
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = nullptr);
|
||||||
static QPoint mousePosition();
|
static QPoint mousePosition();
|
||||||
static CursorState cursorState();
|
static State cursorState();
|
||||||
|
|
||||||
CursorHandlePtr standardWindowCursor(Qt::CursorShape s = Qt::ArrowCursor);
|
CursorHandlePtr standardWindowCursor(Qt::CursorShape s = Qt::ArrowCursor);
|
||||||
CursorHandlePtr pixmapWindowCursor(const QCursor &c);
|
CursorHandlePtr pixmapWindowCursor(const QCursor &c);
|
||||||
|
@ -260,7 +260,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QWindowsOleDropSource::QWindowsOleDropSource(QWindowsDrag *drag)
|
QWindowsOleDropSource::QWindowsOleDropSource(QWindowsDrag *drag)
|
||||||
: m_mode(QWindowsCursor::cursorState() != QWindowsCursor::CursorSuppressed ? MouseDrag : TouchDrag)
|
: m_mode(QWindowsCursor::cursorState() != QWindowsCursor::State::Suppressed ? MouseDrag : TouchDrag)
|
||||||
, m_drag(drag)
|
, m_drag(drag)
|
||||||
, m_windowUnderMouse(QWindowsContext::instance()->windowUnderMouse())
|
, m_windowUnderMouse(QWindowsContext::instance()->windowUnderMouse())
|
||||||
, m_currentButtons(Qt::NoButton)
|
, m_currentButtons(Qt::NoButton)
|
||||||
@ -455,7 +455,7 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
|
|||||||
break;
|
break;
|
||||||
case TouchDrag:
|
case TouchDrag:
|
||||||
// "Touch drag" with an unsuppressed cursor may happen with RDP (see createCursors())
|
// "Touch drag" with an unsuppressed cursor may happen with RDP (see createCursors())
|
||||||
if (QWindowsCursor::cursorState() != QWindowsCursor::CursorSuppressed)
|
if (QWindowsCursor::cursorState() != QWindowsCursor::State::Suppressed)
|
||||||
SetCursor(nullptr);
|
SetCursor(nullptr);
|
||||||
if (!m_touchDragWindow)
|
if (!m_touchDragWindow)
|
||||||
m_touchDragWindow = new QWindowsDragCursorWindow;
|
m_touchDragWindow = new QWindowsDragCursorWindow;
|
||||||
|
Loading…
Reference in New Issue
Block a user