Thanks!
After modifying the stackoverflow code to work with PySide2, it works fine for displaying a QMessageBox. For any QWidget derived item, the application crashes upon trying to draw it (so immediately), deep inside painting code.
window = None
for widget in all_widgets:
if str(widget.objectName()) == "main_window":
window = widget
break
//works
//crash during paint
label
= QLabel("<font color=red size=40>Hello World!</font>")label.setParent(window)
label.show()
from PySide2.QtWidgets import QApplication, QLabel, QMessageBox, QPushButton
all_widgets = QApplication.instance().allWidgets()
window = None
for widget in all_widgets:
if str(widget.objectName()) == "main_window":
window = widget
break
//works
QMessageBox.information(window, 'Test', 'Hello!', QMessageBox.Ok)
//crash during paint
label = QLabel("<font color=red size=40>Hello World!</font>")
label.setParent(window)
label.show()
To copy to clipboard, switch view to plain text mode
backtrace: https://pastebin.com/d3qTSgef
Smells a bit like a use-after-free, maybe there is an issue with having to specify that I take ownership of the widget or something ...
Thanks again
Bookmarks