Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.11.3, 5.12.3
-
None
-
Windows 10, Laptop screen FHD, LG monitor 4K.
Description
On Windows is you have multi-monitor setup and QCursor was created from image (svg in my case).
QCursor TestClass::createCursorFromImage(const QString &imagePath, int cursorWidth, int cursorHeight, double dpr) { const auto scaledWidth = qRound(cursorWidth * dpr); const auto scaledHeight = qRound(cursorHeight * dpr); auto pixmap = QIcon(imagePath).pixmap(scaledWidth, scaledHeight); pixmap.setDevicePixelRatio(dpr); return QCursor(pixmap); };
Pixmap has the correct size for each screen. DPR is correct too. In this case, the cursor will fit size only for non-primary monitor (no matter scale).