Skip to content

isinstance has wrong result for PythonQt widgets #358

Description

@CarstenWalther

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions