Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.12.0
-
None
-
Python 3.7
PySide 5.12.0
Windows 10
Description
Apparently, this two things aren't the same.
item.metaObject().className() == "QWidget" and isinstance(item, QWidget)
Well, I use a loop to iterate over every widget in my entire application to assign special stylesheets. To do so, I call widget.children() on the top ones and run the style code. On specific widgets like QGroupBox or QTabWidget there are widgets inside them so I have to also iterate over them and call widget.children() on themselves, as seen in my code.
Now, the issue is that if I set isinstance(QWidget) it doesn't assign the correct colors and breaks because it iterates over different widgets, but if I use item.metaObject().className() == "QWidget" then it works just fine. (There's a screenshot where the bug was found).
To see the live behaviour on an app, this is a 30 seconds video I recorded showing the issue on a Python app: https://www.youtube.com/watch?v=H_7a7AImswQ&feature=youtu.be