Re: Embedded widgets size
Re: Embedded widgets size
Re: Embedded widgets size
Quote:
Originally Posted by
Indalo
In the example above there is table in the scene, and if scene will be set to QGraphicsView, the table doesn't fit size according to the size of QGraphicsView.
Why would it? The item won't adjust to the size of the scene (or the view) by itself. You have to reimplement the views resizeEvent(), resize the scene and modify geometry of the item containing the layout.
Re: Embedded widgets size
wysota, thanks. Could you explain a little bit more exactly? As I got, firstly I have to reimplement QGraphicsView::resizeEvent(). There I would change size of the scene to the new size of QGraphicsView. And then...? I need to call setGeometry to every item in the scene? But how could I calculate new sizes of item? By "hand" or what?