Skip to content

Commit cdd5ed8

Browse files
Update README.md
1 parent 9961a0a commit cdd5ed8

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

README.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -87,36 +87,7 @@ for more details on API limitations when comparing to Qwt.
8787

8888
### Why PySide2 support is still experimental ###
8989

90-
<img src="https://raw.githubusercontent.com/PierreRaybaut/PythonQwt/master/doc/images/pyqt5_vs_pyside2.png">
91-
92-
Try running the `curvebenchmark1.py` test with PyQt5 and PySide: you will notice a
93-
huge performance issue with PySide2 (see screenshot above). This is due to the fact
94-
that PyQt5 (and PyQt4) allows an efficient way of filling a QPolygonF object from a
95-
Numpy array, and PySide2 is not (see function `qwt.plot_curve.series_to_polyline`
96-
below).
97-
98-
```python
99-
def series_to_polyline(xMap, yMap, series, from_, to):
100-
"""
101-
Convert series data to QPolygon(F) polyline
102-
"""
103-
xData = xMap.transform(series.xData()[from_ : to + 1])
104-
yData = yMap.transform(series.yData()[from_ : to + 1])
105-
size = to - from_ + 1
106-
if PYSIDE2:
107-
polyline = QPolygonF()
108-
for index in range(size):
109-
polyline.append(QPointF(xData[index], yData[index]))
110-
else:
111-
polyline = QPolygonF(size)
112-
pointer = polyline.data()
113-
dtype, tinfo = np.float, np.finfo # integers: = np.int, np.iinfo
114-
pointer.setsize(2 * polyline.size() * tinfo(dtype).dtype.itemsize)
115-
memory = np.frombuffer(pointer, dtype)
116-
memory[: (to - from_) * 2 + 1 : 2] = xData
117-
memory[1 : (to - from_) * 2 + 2 : 2] = yData
118-
return polyline
119-
```
90+
There is still a significant performance issue with PySide2 (drawing polylines with PySide2 is apparently approx. 60 times slower than with PyQt5, see [this bug report](https://bugreports.qt.io/browse/PYSIDE-1366)).
12091

12192
As a consequence, until an equivalent feature is implemented in PySide2, we strongly
12293
recommend using PyQt5 instead of PySide2.
@@ -154,4 +125,4 @@ the associated code is distributed under the terms of the LGPL license. The
154125
rest of the code was either wrote from scratch or strongly inspired from MIT
155126
licensed third-party software.
156127

157-
See included [LICENSE](LICENSE) file for more details about licensing terms.
128+
See included [LICENSE](LICENSE) file for more details about licensing terms.

0 commit comments

Comments
 (0)