[PySide] Expose QPainter draw methods that accept pointers

Ognyan Moore ognyan.moore at gmail.com
Sat May 7 05:06:16 CEST 2022

Hello PySide developers,

I am one of the maintainers of pyqtgraph.  I'm writing to request that
PySide expose more of the QPainter draw methods that accept pointers.

The method we would most benefit from PySide exposing to us is
QPainter::drawLines(const QLine *lines, int lineCount)

To demonstrate a typical usage, I will do a simplified version of how we
use QPainter::drawPixmapFragments which does allow a pointer to be passed

import numpy as np
size = 1_000
arr = np.empty((size, 10), dtype=np.float64)
ptrs = shiboken6.wrapInstance(arr.ctypes.data,
QPainter.drawPixmapFragments(ptrs, size, pixmap)

Having this functionality would definitely make our code substantially more
efficient.  If it's not too much trouble, we would appreciate other draw
methods that accept pointers to be available from PySide; however, those
are not as critical to us.

QPainter::drawConvexPolygon(const QPointF *points, int pointCount)
QPainter::drawPoints(const QPointF *points, int pointCount)
QPainter::drawPolygon(const QPointF *points, int pointCount, Qt::FillRule
fillRule = Qt::OddEvenFill)
QPainter::drawRects(const QRectF *rectangles, int rectCount)
QPainter::drawPolyline(const QPointF *points, int pointCount)

Let me know if I can provide any additional information!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20220506/0d230283/attachment.htm>

More information about the PySide mailing list