PlotPyStack / PythonQwt

Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)
https://pypi.org/project/PythonQwt/
Other
86 stars 25 forks source link

Print to PDF: AttributeError: 'NoneType' object has no attribute 'getContentsMargins' #80

Closed PierreRaybaut closed 11 months ago

PierreRaybaut commented 11 months ago

How to test?

Run the Bode diagram demo. Click on "Print" button and save to PDF.

Traceback (most recent call last):
  File "C:\Dev\Libre\PythonQwt\qwt\tests\test_bodedemo.py", line 259, in print_
    renderer.renderTo(self.plot, printer)
  File "C:\Dev\Libre\PythonQwt\qwt\plot_renderer.py", line 321, in renderTo    
    self.render(plot, p, rect)
  File "C:\Dev\Libre\PythonQwt\qwt\plot_renderer.py", line 359, in render      
    left, top, right, bottom = plot.layout().getContentsMargins()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'getContentsMargins'