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

Incorrect Appearance QCursor with AA_EnableHighDpiScaling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.3, 5.12.3, 5.14.1
    • Fix Version/s: None
    • Component/s: GUI: High-DPI
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      When setting QApplication::setAttribute(Qt::AA_EnableHighDpiScaling) and using a QCursor with custom bitmap and bitmap mask, the cursor appears ugly (and sometimes completely messed up for larger resolutions for the bmp), the size is incorrect (scaled way too big) and the hotspot is not in the correct location (as if it were a small-sized cursor).

      QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      QBitmap bit = QBitmap("crossMinus.bmp");
      QBitmap bitMask = QBitmap(bit.width(), bit.height());
      bitMask.fill(Qt::color0);
      QCursor* s_crossCursor = new QCursor(bit, bitMask, -1, -1);
      window->setCursor(*s_crossCursor);

        Attachments

        1. crossMinus.bmp
          crossMinus.bmp
          0.2 kB
        2. crossMinus100.bmp
          crossMinus100.bmp
          2 kB
        3. cursor_issue_hdpi.cxx
          0.7 kB
        4. CursorAppearance.JPG
          CursorAppearance.JPG
          90 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            einsteinv Gert van de Steeg
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes