create internals.PrimitiveArray#2591
Conversation
|
Hi @pijyoi I love this PR. Migrating this complexity from the GraphicsItems themselves to Qt.internals was absolutely the right thing to do. Abstracting PrimativeArray to work with all bindings, regardless of whether they support the lower-level methods is fantastic. My one nit-pick is that we should probably stay away from descriptions like "newer" and "older" regarding the versions of Qt bindings and just specify which version sip.array was introduced explicitly (or I suppose, more specifically |
|
I used more general language in the comments and let the code document itself as to the exact versions required. |
Saw that, but before you know it, 10 years will have passed :D If you'd rather leave it as is, that's fine with me. This class has fantastic comments as it is. Merging |
Refactor the array code in
ScatterPlotItemandPlotCurveIteminto PrimitiveArray.It may look as though that there is one behavior change made in this PR. Previously in
ScatterPlotItem, if the number of items was zero, then the call todrawPixmapFragmentswould be skipped.I have looked through the logs, and this skipping behavior was added when adding support for PyQt's
sip.array. Testing shows that PyQt does currently support zero-length sip arrays. I suspect it was added when testing against preliminary versions ofsip.array.Script to verify that zero-length
sip.array(s) work.Besides cleaning up the code, this PR will hopefully make it simpler to add support for
drawRectsanddrawPoints.Sample script to exercise
drawRectsusing this PR. This may help #2287.