Yes, sorry. I've got carried away. I do understand your point. And I agree that it's best to avoid situations where there are unhandled exceptions in Python code called from Qt. Because it may prevent some important code on the C++ side from executing. I'm just confused by the difference in this case, as the behavior changes between versions and when overriding methods in other classes. The thing is, in my short experience with PySide6, I somehow assumed the wrapper handled exception forwarding back to Python automatically. Apparently, that is not the case and I've been lucky until recently.
I'll take your suggestion.
@JonB said in Problem with exception handling in QOpenGLWidget:
There may be better approached (I am not a Python expert), but to help debugging you might write everything like this:
try:
<your code>
except Exception as e:
unhandled_exception(e)
<suitable continuation>
def unhandled_exception(e):
print (e)
The only difference is that instead of print, I'll use logging.error to get an exception traceback.
Thank you for your time!