I had a crash in my Qt application and I wanted to ask here. However, the error I am facing is very uninformative, as it occurs without an error message in the console from Python or Qt.
Although the question is general, I took the time to write an example code where you can see this type of failure:
import subprocess
with open("prueba.py", "w", encoding="utf-8") as file:
file.write("n".join((
"from PySide2.QtWidgets import QApplication, QWidget",
"",
"app = QApplication()",
"",
"widget = QWidget()",
"widget.setParent(app)",
"app.exec_()"
)))
print(subprocess.run(["python", "-m", "prueba"]).returncode)
In which, I use subprocess in order to obtain the exit code (in this case 3221225477).
I tried:
-
Although I have not read all the documentation, I read the documentation for QCoreApplication, QObject and QThread on the PySide2.QtCore page (although the latter is a Python binding, it usually includes all the methods, virtual functions, etc.).
-
Search for Qt exit codes.
-
I came across this answer, but I wouldn’t know how to apply it to Python or what it entails.
Therefore, how could I get the hypothetical error?