Why does a modal QMessageBox need a parent?

c.buhtz at posteo.jp c.buhtz at posteo.jp
Fri Aug 11 11:14:21 BST 2023


Hello,

I do use PyQt5. I use the static methods of QMessageBox to create modal 
message box with informations, warnings, etc.
According to the docu [1] it seems that the first parameter is the 
parent.

But why do I need "parent" when the dialog is modal? It works well when 
"parent=None". I see no problem. Are there any shortcomings makeing 
"parent=None"?

Thanks in advance
Christian

[1] -- 
<https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtwidgets/qmessagebox.html?highlight=qmessagebox#QMessageBox>


More information about the PyQt mailing list