QListWidget findChild Return Value

John Thornton dev at gnipsel.com
Mon Dec 11 17:16:52 GMT 2023


When trying to find out if a QListWidget is loaded with

if self.findChild(QListWidget, "listWidget"):

it returns False even though the widget is present.

if I test for not None I get True

if self.findChild(QListWidget, "listWidget") is not None:

I can't find any other widget that fails to be found by name.

I asked the question on stackoverflow

https://stackoverflow.com/questions/77640161/pyqt6-findchild-fails-with-qlistwidget

JT



More information about the PyQt mailing list