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

Qt::CrossCursor has wrong hotspot

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.7, 5.9.0
    • QPA: X11/XCB
    • None
    • libxcb 1.11 / xorg-x11-7.6 (opensuse leap 42.3)

    Description

      While investigating another bug I used Qt::CrossCursor to determine the correct cursor position. But everytime I got a +1pixel offset (x and y) and could not explain where it should come from. In the end I decided to use an own 1x1 cursor:

      QPixmap pm(1,1);
      pm.fill(Qt::red);
      QCursor redCursor(pm, 0, 0);
      

      Now all positions were as expected.

      Attached a testcase to show the problem. It changes the cursor every 500ms from my own to the cross cursor and back. Placing the cursor at e.g. the QTreeWidgetItem frame you will see that the cross cursor has a one pixel offset. I would expect that the cross cursor center is the hotspot of the cursor.

      Since this also happens in Qt4 it's maybe a xcb problem but I'm unsure where to look further.

       

      Attachments

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

        Activity

          People

            liaqi Liang Qi
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes