Details
Description
When I try to call painter.device() in QGraphicsScene.drawForeground() method, I got
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
Minimal working example:
from PySide2 import QtWidgets class MyScene(QtWidgets.QGraphicsScene): def drawBackground(self, painter, rect): print(painter.device()) painter.drawText(0, 0, 'Hi') super().drawBackground(painter, rect) def drawForeground(self, painter, rect): print(painter.device()) print(painter.device().physicalDpiX()) # <-- this causes termination painter.drawText(30, 0, 'Hallo') super().drawForeground(painter, rect) if __name__ == '__main__': app = QtWidgets.QApplication([]) scene = MyScene() scene.addText("Hello, world!") view = QtWidgets.QGraphicsView(scene) view.show() app.exec_()
Attachments
For Gerrit Dashboard: PYSIDE-868 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
247943,1 | WIP:Special cast function: cast on the proper object | 5.12 | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |
248163,8 | Fix crash related to multiple inheritance | 5.12 | pyside/pyside-setup | Status: MERGED | -2 | 0 |
558001,4 | shiboken6: Simplify code in argument pointer conversion | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
558189,9 | shiboken6: Make multiple inheritance cast check less restrictive | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
558384,2 | shiboken6: Simplify code in argument pointer conversion | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
560738,3 | Also check the downcast for types found by dependency graph lookup | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |