Skip to content
  • 0 Votes
    5 Posts
    372 Views
    Q

    @Pl45m4 said in QGraphicsScene and event handling:

    Due to optimization, not the whole scene is redrawn after operation, so if somehow some painted path/region of a (re-)moved or resized item exceeds the boundingRect, this area might not get updated. Therefore remains might stay visible.

    This indeed was one problem. The other one was that despite the call to removeItem(), the item stayed in the BSPTree, because the boundingRect changed without a previous call to prepareGeometryChange() (which I had everywhere except in this hidden case). Clearly my fault! Overall, this is not very fault tolerant and also not easy to debug! In a way, it would be nice to have a function that could be called (during debugging) to do some consistency checking, rather than only finding out much later during a paint event.

  • 0 Votes
    3 Posts
    333 Views
    J.HilkJ

    locked as a dublicate of
    https://forum.qt.io/topic/143047/connect-parent-window-to-child-s-close-event

    give people time to answer, usually at least 24 hours.

    This is a user driven forum, no-one is paid to be here :D

  • 0 Votes
    6 Posts
    1k Views
    SGaistS

    Interface is the keyword here: interface != widget.

    You build a widget with the interface you defined but the interface itself is not a widget.

  • 0 Votes
    9 Posts
    3k Views
    M

    Thank you all for the valuable information you have given me!

    In the end I got around the inability to use the main event loop by running my new part on a separate thread, with this pattern:

    QThread myThread;
    MyNewPart newPart;
    newPart.moveToThread(&myThread);
    /* Connect(...) QThread::started -> MyNewPart::run*/
    myThread.start();

    Everything works without changing the code :)

  • 0 Votes
    1 Posts
    670 Views
    No one has replied