python.utils.qt module

safe_delete_later(widget)[source]

Will call the deleteLater method on the given widget, but only if running in a Qt4 environment. This allows us to proactively delete widgets in Qt4, but protects us from garbage collection issues associated with doing the same in PySide2/Qt5.

Parameters:widget – The widget to potentially call deleteLater on.