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

QGraphicsScene is not emitting signal "changed"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.8.2
    • Widgets: GraphicsView
    • None
    • Windows

    Description

      I have a QGraphicsScene, to which I connect my own view, that is not derived from a QWidget. Generally, everything works. However, my view never receives the signals changed or sceneRectChanged.

      Specifically, my QGraphicsObject calls update() when it needs a repaint. But this does not lead to the signals changed or sceneRectChanged being emitted.

      I have the following simple code, that I think should trigger when update() is called:

              QObject::connect(mQGraphicsScene, &QGraphicsScene::changed,
                                        [](const QList<QRectF>& region) {
                                            MyMessage(6, "QGraphicsScene::changed signal received.\n");
                                        });
              QObject::connect(mQGraphicsScene, &QGraphicsScene::sceneRectChanged,
                                        [](const QRectF& rect) {
                                            MyMessage(6, "QGraphicsScene::sceneRectChanged signal received.\n");
                                        });
      

      The code in the lambdas is never called - I checked with the debugger and also for the printed message.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            emmenlau Mario Emmenlauer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes