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

QGraphicsItem inconsistent collidingItems from paint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.5
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None

      Description

      When calling collidingItems() from the paint method of QGraphicsItem, a distinct value is returned if the method call happens to be from the gui thread, or from scene()->render().

      To use the testcase in attachment, first read the main.cpp and foo.cpp files, then run  "waf configure build" to run if deemed necessary. The only two graphics items collide with each other, so no "0" should be ever output to the console.

      While changing the index method seems to be a workaround, it would be great to know why such an inconsistency is happening.

          scene.setItemIndexMethod(QGraphicsScene::NoIndex);

      Also, if checking for collisions while painting is a bad idea, then a hint somewhere would be good to have too

       

        Attachments

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

          Activity

            People

            Assignee:
            bibr Andreas Aardal Hanssen
            Reporter:
            ita256 ita
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes