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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions