1. Bug was in the `def paintGL(self)` method (at least with PySide1): image was mirrored upside down.
2. Added support for `setConfigOptions(imageAxisOrder='row-major')`
3. Small cosmetic changes
Previously LayoutWidget.addLabel and LayoutWidget.addLayout called a function "addItem", that didn't exist. Corrected to call LayoutWidget.addWidget.
This fixes#242
PySide has a known memory leak issue when using QImage. It does not handle the reference counter correctly. I manually adjusted the reference counter to the data as suggested in a bug report by Neil Whelchel. This bug report can be found at https://bugreports.qt.io/browse/PYSIDE-140
also fixes:
- use rfft for better efficiency
- use rfftfreq to compute coords correctly
- works for both odd/even lengths
- python3: integer division needed for numpy indexing
Running pyqtgraph with python -OO gives the following crash
colin@desktop:~$ python3 -OO -c 'import pyqtgraph'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/pyqtgraph/__init__.py", line 216, in <module>
from .graphicsItems.HistogramLUTItem import *
File "/usr/local/lib/python3.5/dist-packages/pyqtgraph/graphicsItems/HistogramLUTItem.py", line 10, in <module>
from .GradientEditorItem import *
File "/usr/local/lib/python3.5/dist-packages/pyqtgraph/graphicsItems/GradientEditorItem.py", line 354, in <module>
class GradientEditorItem(TickSliderItem):
File "/usr/local/lib/python3.5/dist-packages/pyqtgraph/graphicsItems/GradientEditorItem.py", line 480, in GradientEditorItem
@addGradientListToDocstring()
File "/usr/local/lib/python3.5/dist-packages/pyqtgraph/graphicsItems/GradientEditorItem.py", line 30, in dec
fn.__doc__ = fn.__doc__ + str(Gradients.keys()).strip('[').strip(']')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
The cause is the @addGradientListToDocstring() annotation in
GradientEditorItem.py that cannot handle functions without docstrings as
produced when using the python -OO option.
Fix this by only adding the gradient list to the docstring if the docstring is
not None.