Skip to content

BusyCursor and QPainter fixes for PyPy#2349

Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:pypy_compat
Jun 23, 2022
Merged

BusyCursor and QPainter fixes for PyPy#2349
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:pypy_compat

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jun 23, 2022

  1. add support for PySide6 6.3.0 QOverrideCursorGuard #2263 added a hasty fix for the addition of QOverrideCursorGuard. That fix doesn't work on PyPy. A more proper fix is implemented here.

  2. QPainter.end() needs to be called when painting is done.

In both of these cases, the issue has to do with the CPython implementation relying on the objects getting destructed when their refcnt drops to zero.

The fixes here are not specific to PyPy per se, but rather, the issues they fix are exposed when run under PyPy.

pijyoi added 2 commits June 23, 2022 21:55
the previous code relied on QOverrideCursorGuard to do the automatic
cleanup. However, that relies on the guard object getting destructed
immediately when its reference count drops to zero. Such an assumption
is not correct when running on PyPy.
on PyPy, we cannot rely on end() begin called automatically when the
QPainter object refcnt drops to zero.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jun 23, 2022

Thanks @pijyoi this LGTM!

@j9ac9k j9ac9k merged commit 79ce6ad into pyqtgraph:master Jun 23, 2022
@pijyoi pijyoi deleted the pypy_compat branch June 23, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants