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

Incorrect Appearance QCursor with AA_EnableHighDpiScaling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.3, 5.12.3, 5.14.1
    • None
    • Windows
    • af0edfbc7 (dev), b63f92bb0 (6.7), e6204b12c (6.6)

    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
        For Gerrit Dashboard: QTBUG-82434
        # Subject Branch Project Status CR V

        Activity

          People

            sorvig Morten Sørvig
            einsteinv Gert van de Steeg
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes