PyInstaller macOS issue: QCombobox not refreshing

I am packaging a python script and I have the following code which correctly updates and selects the first index in one packaging environment, but doesn’t in another. Unfortunately that environment where the code works as expected fails for some other obscure reason.

It’s not the end of the world as on seeing a blank Combobox the user can make a selection, however it would be nice to have some code that worked correctly in all environments!

All wisdom/ideas/thoughts/inspiration gratefully accepted!

connections = SerialPorts()
ports = connections.available()
# clear & then populate combobox with ports,
# from which the client can choose.

After rebuilding the environment from scratch I concluded that this issue is due to the unresponsiveness of Python Applications running in the distribution environment create by the PyInstallation process.

The issue of QCombobox (plus all other widgets) not being update is due to the GUI not redrawing itself. If the application is forced to redraw itself, perhaps by minimising and then selecting, the QCombobox is redrawn correctly. It’s as if QApplication.exec isn’t being permitted to process drawing events.

All wisdom/ideas/thoughts/inspiration gratefully accepted!