[Interest] Prevent QGraphicsView calling fitInView() after addItem()

Ch'Gans chgans at gna.org
Fri Apr 7 08:23:27 CEST 2017


On 7 April 2017 at 16:43, Patrick Stinson <patrickkidd at gmail.com> wrote:
> Hi there!
>
> It appears that the default behavior for QGraphicsView is to call fitInView() to center all the items in the scene when a new item is added. Is there a way to prevent this? I don’t see anything in the docs.
>

I don't think so, does your scene have a fixed scene rect?
QGraphicsView tend to behave "weirdly" when the scene has no fixed scene rect.

As well this might be of interest:
http://doc.qt.io/qt-5/qgraphicsview.html#transformationAnchor-prop

Chris


> Thanks!
> -P
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list