ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Call resizeEvent after constructing the application #36

Closed ivoflipse closed 11 years ago

ivoflipse commented 11 years ago

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)

image

ivoflipse commented 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.

ivoflipse commented 11 years ago

image

Looking a lot better and it even seems to work for human feet!

ivoflipse commented 11 years ago

I keep having trouble with the resizeEvent for widgets that aren't visible: image

Because it does get called when switching to Analysis, so perhaps I can somehow clear it and draw again at the new size?

ivoflipse commented 11 years ago

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