Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.11.2
-
None
-
n/a
Description
When implementing a new drawing back-ends for QPainter in Python custom implementations of QPaintEngine and QPaintDevice must be created within Python. These derived classes are required to implement certain virtual methods to implement the appropriate drawing behavior.
The following methods of QPaintEngine are passed several values via pointer and count arguments:
- QPaintEngine.drawPolygon(points, pointCount, mode)
- QPaintEngine.drawLines(lines, lineCount)
- QPaintEngine.drawPoints(points, pointCount)
- QPaintEngine.drawRects(rects, rectCount)
Since Python implementations of these functions will just be passed a wrapped version of the first value, it is not possible (as best I understand) to access subsequent values.
The example program (attached) shows 'drawPolygon' being called in response to a QPainter.drawLine call and receiving only the coordinate of the start of the line:
$ python example.py drawPolygon called with PySide2.QtCore.QPointF(1.000000, 2.000000), 2, PySide2.QtGui.QPaintEngine.PolygonDrawMode.PolylineMode
Ideally these functions (in Python) should be called with a list (or similar) or some well documented mechanism for iterating over elements be provided.
Attachments
Issue Links
- duplicates
-
PYSIDE-3002 virtual drawPoints, drawPolygon, and drawRects of QPaintEngine allow drawing only one item
-
- Closed
-