Important: Please read the Qt Code of Conduct -

Scrolling QGraphicsView and QGraphicsScene[SOLVED]

  • Hi,
    I have QGraphicsScene instance set to QGraphicsView on the GUI with scrollbars enabled and full view port update. But when I scroll my graphics view I get the items added to qgraphics scene disappeared on some point, though they are added in code correctly and are expected to be displayed upon scroll ( custom class inherited from QGraphicsItem ):

    @class CSquare : public QObject, public QGraphicsItem@
    One can see how they disappear on application run on this video screen cast:


    Can somebody hint what is the problem, how to resolve so the graphics items will not disappear on the view?

    Thanks in advance.

  • The problem was in custom function in the inherited class:
    @QRectF boundingRect() const;@
    That should return valid rectangle. Now I fixed that in my project and m going to remove the video.
    Thank you very much. 

Log in to reply