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:
Anton Kudryavtsev 2018-09-20 11:53:46 +03:00 committed by Anton Kudryavtsev
parent c8178fd52e
commit 9941719a8d
3 changed files with 12 additions and 12 deletions

View File

@ -660,18 +660,18 @@ QPoint QWindowsCursor::mousePosition()
return QPoint(p.x, p.y);
}
QWindowsCursor::CursorState QWindowsCursor::cursorState()
QWindowsCursor::State QWindowsCursor::cursorState()
{
enum { cursorShowing = 0x1, cursorSuppressed = 0x2 }; // Windows 8: CURSOR_SUPPRESSED
CURSORINFO cursorInfo;
cursorInfo.cbSize = sizeof(CURSORINFO);
if (GetCursorInfo(&cursorInfo)) {
if (cursorInfo.flags & CursorShowing)
return CursorShowing;
if (cursorInfo.flags & cursorShowing)
return State::Showing;
if (cursorInfo.flags & cursorSuppressed)
return CursorSuppressed;
return State::Suppressed;
}
return CursorHidden;
return State::Hidden;
}
QPoint QWindowsCursor::pos() const

View File

@ -89,10 +89,10 @@ typedef QSharedPointer<CursorHandle> CursorHandlePtr;
class QWindowsCursor : public QPlatformCursor
{
public:
enum CursorState {
CursorShowing,
CursorHidden,
CursorSuppressed // Cursor suppressed by touch interaction (Windows 8).
enum class State {
Showing,
Hidden,
Suppressed // Cursor suppressed by touch interaction (Windows 8).
};
struct PixmapCursor {
@ -119,7 +119,7 @@ public:
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = nullptr);
static QPoint mousePosition();
static CursorState cursorState();
static State cursorState();
CursorHandlePtr standardWindowCursor(Qt::CursorShape s = Qt::ArrowCursor);
CursorHandlePtr pixmapWindowCursor(const QCursor &c);

View File

@ -260,7 +260,7 @@ private:
};
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_windowUnderMouse(QWindowsContext::instance()->windowUnderMouse())
, m_currentButtons(Qt::NoButton)
@ -455,7 +455,7 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
break;
case TouchDrag:
// "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);
if (!m_touchDragWindow)
m_touchDragWindow = new QWindowsDragCursorWindow;