Set style in before compiling ui file for consistent sizing #2173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Close #2167.
Description
In
gui/mvp_base/view.py
the Qapplication instance style is now set before the .ui file is compiled, which avoids the Spectrum Viewer from unreliably showing in differing sizes, which caused issues with reliable eyes tests.Acceptance Criteria
As in the issue #2167, check open MI with data and open and close the spectrum viewer a large number of times to check that it is consistently being produced at the same size which should be around QSize(914, 978) but may differ depending on your resolution. You can use
python -m mantidimaging --path '/data/imaging/IMAT00010675_128/Tomo' -sv
Alternatively, you can run the screenshot tests with the added option
-k test_spectrum_viewer_add_new_roi
You may want to use a print statements like
and in
spectrum_viewer\view.py
:to see the sizing in the command line.
to check the sizing