I have a QGraphicsItem subclass that is a rectangle with text on it. I want to be able to zoom in from the view but the rectangles should only be scaled horizontally. I can't do it like this view->scale(2,1) because then the text and the edges of the QGraphicsItems will get warped. In other words, the rectangles should appear to increase in width but the text on these rectangles should stay the same size.
To do that properly I have to modify the scene to change the width of the rectangles every time I zoom in or zoom out. This in itself is not a problem because I only have one view and it works fine but I think it diminishes the point of separating the view from the scene since zooming is something that is only related to how you view the scene. It also adds a lot of ugly code to the qgraphicsitem subclass and the qgraphicsscene subclass.
There are other solutions like painting the text on the rectangles from the view but that is even uglier than changing the width of the rectangles.
Does anyone know of a better solution?
Thanks in advance.
Bookmarks