You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QtPy 2.4.2 has integrated this PR: #461, which swaps QToolbar and QAction types with custom subclasses. This introduced a new problem that instances returned from Qt no longer pass instance checks.
This will pass in QtPy 2.4.1 and will fail with QtPy 2.4.2. It now requires to check against true PyQt classes, e.g. assert isinstance(new_toolbar, PyQt5.QtWidgets.QToolBar)
By extension, returned instances will have different behavior from the manually created ones
The text was updated successfully, but these errors were encountered:
ivany4
changed the title
Hijacked PyQt types fail instance check
Hijacked PyQt types are not returned from native Qt APIs
Nov 11, 2024
QtPy 2.4.2 has integrated this PR: #461, which swaps
QToolbar
andQAction
types with custom subclasses. This introduced a new problem that instances returned from Qt no longer pass instance checks.E.g.:
This will pass in QtPy 2.4.1 and will fail with QtPy 2.4.2. It now requires to check against true PyQt classes, e.g.
assert isinstance(new_toolbar, PyQt5.QtWidgets.QToolBar)
By extension, returned instances will have different behavior from the manually created ones
The text was updated successfully, but these errors were encountered: