I had this code for affine transform to draw on a QWidget.
AFT.reset();
AFT.translate(scrollh, scrollv); // pixelxs h from 0 to middle of widget , pixelxs v from 0 to middle of widget
AFT.scale(scalx, -scaly); // scale relation betwen my world bounds in cartersian coordinates and the width / heigth of the widget.
AFT.translate(-xc, -yc); // real coordinates of the center
Now I'm going to use Qgraphicsview / Qgraphicscene.
I have a widget extends Qgraphicsview with a Qgraphicscene. created into it.
I appy the transform to the view. (setTransform (AFT);
I draw my elements. OK, the initial view is centered and this 'world' entitities are drawed right.
If I increase or decrease the scalx scaly, the redraw shows me a world not centered, with an arbitratious center choosen.
Only when the scale is bigger (like a zoom - ) than neccesary the 'world' is centered.
(My code worked well when it was applied to a qwidget/paint )
Qgraphicsscene has not limits (that is to say I have not SceneRect)
Any idea ? It is as Qgraphicsscene was doing something -.....
Thanks
Bookmarks