summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscursor.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-27 13:19:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-28 13:40:55 +0100
commit97bc28778227d00affb8cbd6a1ac9a2258cdf95d (patch)
treecde216ad9df865fbfbd6c62413dfd473d1852036 /src/plugins/platforms/windows/qwindowscursor.cpp
parent245e630cfdcb1628ef871a9fba9f8389ff6ad5d8 (diff)
QWindowsCursor: Add API for determining the cursor state.
Detect the 'suppressed' state new in Windows 8. Change-Id: I0faa994aa7b91869cedba36b777b1784818efcce Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscursor.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index e0d7d0c919..d574730328 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -465,6 +465,22 @@ QPoint QWindowsCursor::mousePosition()
return QPoint(p.x, p.y);
}
+QWindowsCursor::CursorState QWindowsCursor::cursorState()
+{
+#ifndef Q_OS_WINCE
+ 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 & cursorSuppressed)
+ return CursorSuppressed;
+ }
+#endif // !Q_OS_WINCE
+ return CursorHidden;
+}
+
void QWindowsCursor::setPos(const QPoint &pos)
{
SetCursorPos(pos.x(), pos.y());