Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75453

Windows: QCursor bad size on multi-monitor setup.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.11.3, 5.12.3
    • GUI: Look'n'Feel
    • None
    • Windows 10, Laptop screen FHD, LG monitor 4K.
    • Windows

      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).

       

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            headhunter Roman Lazurak
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes