[PySide] Expose QPainter draw methods that accept pointers

Keith Kyzivat keith.kyzivat at qt.io
Sat May 7 18:21:11 CEST 2022

Hi Ognyan,

Could you report those as feature requests to https://bugreports.qt.io? That would make it easier to track.

Get Outlook for Android<https://aka.ms/AAb9ysg>
From: PySide <pyside-bounces at qt-project.org> on behalf of Ognyan Moore <ognyan.moore at gmail.com>
Sent: Friday, May 6, 2022 11:06:16 PM
To: pyside at qt-project.org <pyside at qt-project.org>
Subject: [PySide] Expose QPainter draw methods that accept pointers

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 in.

import numpy as np
size = 1_000
arr = np.empty((size, 10), dtype=np.float64)
ptrs = shiboken6.wrapInstance(arr.ctypes.data, QtGui.QPainter.PixmapFragment)
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/20220507/9fcf59ce/attachment.htm>

More information about the PySide mailing list