GUI/v22 review stacked frames, resolve multiple connections
We are currently using QStackedWidget
s to switch between 1d and 2d plots. Furthermore, we have different widget stacks to represent data, simulations, and fits. In consequence, we have three different instances of Plot1DFrame
and Plot2DFrame
. Each of them has connect
ions from global actions to class methods. Therefore, when an action is triggered, each of these connections is activated, and the connected methods are run in each class instance. This is undesirable as far as invisible frames are concerned, and currently causes crashes.
Three possible solutions:
- In each connection, test whether the targetted frame class is visible -> unelegant and error-prone
- Get rid of the stacked widgets; create plot frame anew when the view changes -> the dreaded forth-and-back refactoring
- Make global actions local -> much in line with generic advise to avoid globals -> go for this.