Skip to content

BUG: Fix module updating mainwindow at load time when using Qt5

Created by: jcfr

With Qt5, relying on "Qtimer::singleShow" with a time of 0ms is not sufficient anymore to ensure the associated slot is called after the main window is shown.

The following errors were reported at startup time:

Failed to obtain reference to 'FileMenu'
Failed to obtain reference to 'qSlicerAppMainWindow'
No Data Probe frame - cannot create DataProbe
Failed to obtain reference to 'qSlicerAppMainWindow'
Failed to obtain reference to 'FileMenu'

To ensure module can update the main window once it is shown, this commit introduces the signal "qSlicerApplication::mainWindowShown()" that can be connected when a scripted or loadable module is initialized.

Once the main window is shown, the signal "mainWindowShown()" ends up being triggered.

Merge request reports