Closed ivoflipse closed 11 years ago
Apparently this problem doesn't arise when the application is created/initialized, but when new data is supplied that may/may not fit as well. So I think the resizeEvent has to be called after something gets drawn.
Looking a lot better and it even seems to work for human feet!
I keep having trouble with the resizeEvent for widgets that aren't visible:
Because it does get called when switching to Analysis, so perhaps I can somehow clear it and draw again at the new size?
I changed self.view.setViewportUpdateMode(self.view.FullViewportUpdate)
which works as follows:
When any visible part of the scene changes or is reexposed, QGraphicsView will update the entire viewport. This approach is fastest when QGraphicsView spends more time figuring out what to draw than it would spend drawing (e.g., when very many small items are repeatedly updated). This is the preferred update mode for viewports that do not support partial updates, such as QGLWidget, and for viewports that need to disable scroll optimization.
This might cause a little flicker when something first gets resized, but it gets the job done AFAIK
The application is created with some default settings, but now that some widgets have a resizeEvent, we should make sure it actually gets used (at least when initializing the app)