Skip to content

Commit 22133e9

Browse files
committed
Update v1 to v2 documentation: clarify plot item icon handling changes
1 parent 1fcc3a8 commit 22133e9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/dev/v1_to_v2.rst

+17
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,20 @@ functions are:
8585
:py:meth:`.PlotBuilder.trimage`, :py:meth:`.PlotBuilder.rgbimage`, and
8686
:py:meth:`.PlotBuilder.quadgrid`. If you were using it, you should
8787
replace it by the new ``alpha_function`` parameter.
88+
89+
Plot item icon handling
90+
^^^^^^^^^^^^^^^^^^^^^^^
91+
92+
The `guiqwt` library was allowing to instantiate plot items without needing to create
93+
a `QApplication` instance (no GUI event loop was required). This was not the case with
94+
`plotpy` V1, so that it was not possible -for example- to serialize/deserialize plot
95+
items to JSON without creating a `QApplication` instance.
96+
97+
With `plotpy` V2, this has been fixed by removing the `QIcon` instantiation from the
98+
plot items constructors (call to `QwtPlotItem.setIcon` method).
99+
100+
Note that -in the meantime- `QwtPlotItem.setIcon` and `QwtPlotItem.icon` methods have
101+
also been removed in PythonQwt V0.14.3.
102+
103+
Code relying on this feature should thus be updated to use the new `get_icon_name`
104+
method instead, i.e. `get_icon(item.get_icon_name())` instead of `item.icon()`.

0 commit comments

Comments
 (0)