aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-01-25 13:23:59 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-26 01:43:25 +0000
commit9cbb340cefc781eff96456a85b90774033e39241 (patch)
tree5df15349894600b37bf2035c549f3a002866903b
parent735472a88b67e4f9871d922a6a46e43d91f36397 (diff)
PyPySide: fix a few more cases of QPainter without end()
This will be replaced by a context manager, soon. Also, begin and end should not simply return a boolean but raise an exception when something serious broke. Task-number: PYSIDE-535 Change-Id: Ieb2f845a01105381aab539e04b964de7a551d739 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit d90d6c260bdf97c6b10e0ff58fbd422a197f9917) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/tests/QtGui/qrasterwindow_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qpen_test.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/sources/pyside6/tests/QtGui/qrasterwindow_test.py b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
index a2d8ecc3e..8224f1e35 100644
--- a/sources/pyside6/tests/QtGui/qrasterwindow_test.py
+++ b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
@@ -53,7 +53,8 @@ class TestRasterWindow(QRasterWindow):
painter = QPainter(self)
painter.fillRect(clientRect, QColor(Qt.red))
painter.drawStaticText(QPoint(10, 10), self.text)
-
+ # PYSIDE-535: PyPy needs an explicit end() or a context manager.
+ painter.end()
class QRasterWindowTest(UsesQGuiApplication):
def test(self):
diff --git a/sources/pyside6/tests/QtWidgets/qpen_test.py b/sources/pyside6/tests/QtWidgets/qpen_test.py
index f1fe0fc5f..7ca73cca8 100644
--- a/sources/pyside6/tests/QtWidgets/qpen_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpen_test.py
@@ -54,6 +54,8 @@ class Painting(QWidget):
self.penFromEnum = painter.pen()
painter.setPen(int(Qt.NoPen))
self.penFromInteger = painter.pen()
+ # PYSIDE-535: PyPy needs an explicit end() or a context manager.
+ painter.end()
QTimer.singleShot(20, self.close)