We have few modules with base UIs and widgets that allows our TDs to reuse and keep our tools consistent .
We have noticed however that clarisse would crash on exit if we import modules defining classes derived from Qt
but it wouldn't crash if the main class is defined on the same file as the import pyqt_clarisse
Here below, this won't crash clarisse
python code
from PySide2 import QtCore,QtWidgets
import pyqt_clarisse
class UI_Dialog(QtWidgets.QWidget):
def __init__(self,parent=None):
super(UI_Dialog,self).__init__()
self.setupUI()
def setupUI:
self.setWindowTitle('Test')
layout= QtWidgets.QVBoxLayout(self)
btn=QtWidgets.QPushButton("button")
layout.addWidget(btn)
App=None
if not QtWidgets.QApplication.instance():
App = QtWidgets.QApplication(["Clarisse"])
else:
App = QtWidgets.QApplication.instance()
dialog = UI_Dialog()
dialog.show()
pyqt_clarisse.exec_(App)
However defining the class in its own module and importing it like this:
python code
from PySide2 import QtCore,QtWidgets
from myModule import UI_Dialog()
import pyqt_clarisse
...
would result in clarisse crashing when exiting ( segmentation fault related to pyside)
The crash only occurs at exit time ( you can close, reopen etc...) but when quitting clarisse the isotropix Crash Reporter would complain about the segmentation fault.
Any idea what can cause this and perhaps, a workaround?
Thanks