aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-05-04 14:44:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-05-05 12:37:04 +0200
commit499832abfdf13eac5aa35f84a62166fb5aa2e034 (patch)
tree973b0d9fa43255f4534cc5831e7df0e494276ba9 /sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp
parent7ed292b19ee6a4cd59b8c8f644abba56a8f13f39 (diff)
Numpy support: Handle short/long/long long integer types
The default type of numpy is int64 on Linux and long in Windows these days. As numpy is still based on the old long/long long scheme for the types, add some mapping. [ChangeLog][shiboken6] numpy support has been extended to handle short/long long integer types. Fixes: PYSIDE-2313 Pick-to: 6.5 Change-Id: I75d9277ae0867401c2c188efb3a50f4c53c4fc24 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp')
-rw-r--r--sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp b/sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp
index 12384a093..8ad31a77a 100644
--- a/sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp
+++ b/sources/pyside6/PySide6/QtDataVisualization/qtdatavisualization_helper.cpp
@@ -57,6 +57,14 @@ QSurfaceDataArray *surfaceDataFromNp(double xStart, double deltaX, double zStart
return result;
switch (view.type) {
+ case Shiboken::Numpy::View::Int16:
+ populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
+ reinterpret_cast<const int16_t *>(view.data), result);
+ break;
+ case Shiboken::Numpy::View::Unsigned16:
+ populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
+ reinterpret_cast<const uint16_t *>(view.data), result);
+ break;
case Shiboken::Numpy::View::Int:
populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
reinterpret_cast<const int *>(view.data), result);
@@ -65,6 +73,14 @@ QSurfaceDataArray *surfaceDataFromNp(double xStart, double deltaX, double zStart
populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
reinterpret_cast<const unsigned *>(view.data), result);
break;
+ case Shiboken::Numpy::View::Int64:
+ populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
+ reinterpret_cast<const int64_t *>(view.data), result);
+ break;
+ case Shiboken::Numpy::View::Unsigned64:
+ populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
+ reinterpret_cast<const uint64_t *>(view.data), result);
+ break;
case Shiboken::Numpy::View::Float:
populateArray(xStart, deltaX, zStart, deltaZ, xSize, zSize, view.stride[0],
reinterpret_cast<const float *>(view.data), result);