diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-12 16:30:05 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-12-14 16:33:34 +0000 |
commit | 1d03ed3f2b6cdad2719b66b056c4c6be2018c460 (patch) | |
tree | ba80ac855faa9cf765ba98d11d58201b841f17cd /src/plugins/platforms/windows/qwindowscursor.cpp | |
parent | 3c8cf550740746a0b6e8ed77569c8c57c9c14f6b (diff) |
Make native cursor handles accessible.
Add QWindowsNativeInterface::nativeResourceForCursor() and
implement for Windows (returning the HCURSOR) and XCB (returning
the xcb_cursor).
Task-number: QTBUG-49386
Change-Id: I963869f6e8741449822ecbe6489f9c42a786c7a6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscursor.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscursor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index c769eb04a4..b946c34a2b 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -780,6 +780,21 @@ QPixmap QWindowsCursor::dragDefaultCursor(Qt::DropAction action) const return m_ignoreDragCursor; } +HCURSOR QWindowsCursor::hCursor(const QCursor &c) const +{ + const Qt::CursorShape shape = c.shape(); + if (shape == Qt::BitmapCursor) { + const auto pit = m_pixmapCursorCache.constFind(QWindowsPixmapCursorCacheKey(c)); + if (pit != m_pixmapCursorCache.constEnd()) + return pit.value()->handle(); + } else { + const auto sit = m_standardCursorCache.constFind(shape); + if (sit != m_standardCursorCache.constEnd()) + return sit.value()->handle(); + } + return HCURSOR(0); +} + /*! \class QWindowsWindowCursor \brief Per-Window cursor. Contains a QCursor and manages its associated system |