Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6
-
None
-
Tested on Macintosh OS X 10.10 but should be true with other versions.
Description
With a few exceptions, it seems impossible to get a high DPI cursor using QCursor. This results in pixelated cursors, even on retina displays.
The exceptions are the few Qt::CursorShape values that correspond to Macintosh built in cursors, such as Qt::ArrowCursor. There are a total of 11 such cursors in QCocoaCursor::convertCursor.
Otherwise,if you use a predefined Qt::CursorShape that is not one of these 11 cursors, or you use QCursor::setPixmap or setBitmap, it does not seem possible to get a high resolution cursor.
In fact, even if you call QCursor::setPixmap, passing a QPixmap that has its devicePixelRatio set to 2, when QCocoaCursor::convertCursor executes, it will downsample the provided pixmap! The equivalent code on Windows does not downsample a pixmap whose devicePixelRatio is > 1, so it is possible to get a high resolution cursor. That's why I'm reporting this as a bug, not a suggestion.
Based on http://lists.apple.com/archives/cocoa-dev/2014/Nov/msg00190.html, it appears that it's possible in Cocoa to get high resolution cursors. If the code in QCocoaCursor::createCursorFromPixmap added an additional representation using the original pixmap with devicePixelRatio > 1, I think we'd get the expected result.
Attachments
For Gerrit Dashboard: QTBUG-52211 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
227482,2 | Show high DPI custom cursor on macOS | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |