Search code examples
qtresizeqgraphicsview

How to resize a QGraphicsView after QGraphicsView::Scale


Is there non-hideous way to resize a QGraphicsView after a call of scale().

My QGraphicsView is embedded in a QScrollArea. When I zoom i want the View the get bigger.

Thx


Solution

  • QGraphicsView itself inherits from QAbstractScrollArea. Embedding it within another QScrollArea would be very strange, and is likely the source of your problems. By default, when you scale a QGraphicsScene larger than the QGraphicsView in which it is displayed, it will show the necessary scroll bars.