QGraphicsScene constantly changing/updating for no reason

  • I have connected the QGraphicsScene::changed() signal to a slot. The signals is getting emitted about four times a second for no good reason. Absolutely nothing in the scene happens yet the changed() signals is being received constantly.

    Why is this happening? I read all the docs and there does not seem to be some interval based auto-update feature that is enabled by default.

    How can I track down this problem?

  • Lifetime Qt Champion


    Did you check which region was triggering the change signal ?

  • I checked the region now and it is always empty unless I actually move an item around:

    void MainWindow::sceneChanged(const QList<QRectF>& region)
    static int i = 0;

    qDebug() << "Update Nr.: " << ++i;
    qDebug() << "Region = " << region << endl;


    Gives the following when idling:
    bUpdate Nr.: 883
    Region = ()

    And this when I actually move around an item:
    Update Nr.: 881
    Region = (QRectF(102.5,210.5 201x21), QRectF(103.5,211.5 201x21))

    Any ideas?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.