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

QGraphicsView.setCursor() ignored after QGraphicsItem.setCursor() called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.15.2
    • Widgets: GraphicsView
    • None

    Description

      When using QGraphicsView.setCursor() after a QGraphicsItem child has had QGraphicsItem.setCursor() called, all subsequent QGraphicsView.setCursor() calls will be ignored.

      I'm sorry to say: this issue, which seems to have existed since at least 2009, is still a a problem in Qt v5.15.2. See bugs QTBUG-3732, QTBUG-17115; the older one of these has some pretty detailed info(/speculation?) about the responsible source code.

      In my app, I can click-and-drag to pan the canvas, or I can click-and-drag to move an item on the canvas. Doing the former without first even hovering over an item on the canvas will activate the closed-hand cursor - but after any interaction with an item, the cursor no longer changes. It seems to be affected by QGraphicsRectItem's (yes, even the rhombus is a rect in disguise), but not QGraphicsLineItem's.

      I'm attaching a screencast to demo this (oh, an oversight while recording: it doesn't seem to matter that the 'rect' is being custom-painted as a rhombus; the problem is the same for round rects and regular rects...).

      (I have added this same text to 17115, but I considered it's probably more appropriate to submit a new bug for v5.x.).

      Attachments

        Issue Links

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

          Activity

            People

              bibr Andreas Aardal Hanssen
              noughtnaut Noughtnaut Noughtnaut
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes