Merge pull request #8509 from radarhere/toqpixmap

Detach PyQt6 QPixmap instance before returning
This commit is contained in:
Hugo van Kemenade 2024-10-29 13:06:37 +02:00 committed by GitHub
commit e214dbf75c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -80,6 +80,12 @@ jobs:
pytest-cov
pytest-timeout
- name: Install CPython dependencies
if: "!contains(matrix.python-version, 'pypy')"
run: >
python3 -m pip install
PyQt6
- name: Install dependencies
id: install
run: |

View File

@ -213,4 +213,7 @@ def toqimage(im: Image.Image | str | QByteArray) -> ImageQt:
def toqpixmap(im: Image.Image | str | QByteArray) -> QPixmap:
qimage = toqimage(im)
return getattr(QPixmap, "fromImage")(qimage)
pixmap = getattr(QPixmap, "fromImage")(qimage)
if qt_version == "6":
pixmap.detach()
return pixmap