summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-16 16:48:42 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-20 19:12:01 +0000
commit296eb88e1c87dc4793b12af4ddfcc67fe88b8ad8 (patch)
tree86198ab0effaca0dff4c18939756b33af3392d42 /src/plugins/platforms/windows/qwindowswindow.h
parent8da24d8a5c6cebed975190cb5fd83b08d6188ebf (diff)
Windows: Refactor cursor handling.
Applying scaling to the pixmaps used in pixmap cursors requires applying a scale factor in a code path now in a constructor of QWindowsWindowCursorData (nested into QWindowsWindowCursor). This needs to be split and the code paths for cursors created from a Qt::CursorShape value and pixmap cursors need to be further separated. Replace the QSharedDataPointer-based QWindowsWindowCursor class by a simple, non-copyable class CursorHandle managing the HCURSOR handle and pass it around using a QSharedPointer. Split the cache in QWindowsCursor into one based on Qt::CursorShape and one based on the cache key aggregated from the pixmap cache keys (using QWindowsPixmapCursorCacheKey renamed from QWindowsCursorCacheKey), simplifying the standard case based on Qt::CursorShape. Reuse class CursorHandle in QWindowsOleDropSource::CursorEntryCursorEntry, which used a similar class. Remove QWindowsCursor::createSystemCursor(). Avoid the construction of temporary QCursor objects for the standard cursors constructed from using resource pixmaps by introducing a struct PixmapCursor containing pixmap and hotspot. Task-number: QTBUG-49511 Change-Id: I5393d64bd70f7dab68c0a8c2255c7685ac367b2f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.h')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 40d7a3f076..4172a3d850 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -225,9 +225,9 @@ public:
#endif // !Q_OS_WINCE
#ifndef QT_NO_CURSOR
- QWindowsWindowCursor cursor() const { return m_cursor; }
+ CursorHandlePtr cursor() const { return m_cursor; }
#endif
- void setCursor(const QWindowsWindowCursor &c);
+ void setCursor(const CursorHandlePtr &c);
void applyCursor();
inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
@@ -278,7 +278,7 @@ private:
Qt::WindowState m_windowState;
qreal m_opacity;
#ifndef QT_NO_CURSOR
- QWindowsWindowCursor m_cursor;
+ CursorHandlePtr m_cursor;
#endif
QWindowsOleDropTarget *m_dropTarget;
unsigned m_savedStyle;