We've gottenreportsfrom users recently that the call to restoreState results in an exception as follows:
File “.../lib/python3.11/site-packages/openmc_plotter/main_window.py”, line 1158, in resizeEvent
if self.shortcutOverlay.isVisible():
^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘MainWindow’ object has no attribute ‘shortcutOverlay’
I suspect this might actually be a bug in PySide6, but nevertheless the changes in this PR should hopefully prevent problems by moving the creation of the shortcutOverlay attribute to before we call restoreState.
When the plotter is loading up, some previous settings are loaded via the
QSettings
class: https://github.com/openmc-dev/plotter/blob/d7ac96ac127f755f87b40b1fa96f008ff3818192/openmc_plotter/main_window.py#L1079-L1083We've gotten reports from users recently that the call to
restoreState
results in an exception as follows:I suspect this might actually be a bug in PySide6, but nevertheless the changes in this PR should hopefully prevent problems by moving the creation of the
shortcutOverlay
attribute to before we callrestoreState
.