isinstance returns the wrong result when checking the type of PythonQt widgets. For example, isinstance tells us that QPushButton is not a QWidget.
from PythonQt.QtGui import QWidget, QPushButton
b = QPushButton()
print(isinstance(b, QWidget))
# Returns False
As a workaround QObject.inherits can be used to get the expected result.
isinstance returns the wrong result when checking the type of PythonQt widgets. For example, isinstance tells us that QPushButton is not a QWidget.
As a workaround QObject.inherits can be used to get the expected result.