Skip to content

Commit

Permalink
Update v1 to v2 documentation: clarify plot item icon handling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Jan 12, 2025
1 parent 1fcc3a8 commit 22133e9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/dev/v1_to_v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,20 @@ functions are:
:py:meth:`.PlotBuilder.trimage`, :py:meth:`.PlotBuilder.rgbimage`, and
:py:meth:`.PlotBuilder.quadgrid`. If you were using it, you should
replace it by the new ``alpha_function`` parameter.

Plot item icon handling
^^^^^^^^^^^^^^^^^^^^^^^

The `guiqwt` library was allowing to instantiate plot items without needing to create
a `QApplication` instance (no GUI event loop was required). This was not the case with
`plotpy` V1, so that it was not possible -for example- to serialize/deserialize plot
items to JSON without creating a `QApplication` instance.

With `plotpy` V2, this has been fixed by removing the `QIcon` instantiation from the
plot items constructors (call to `QwtPlotItem.setIcon` method).

Note that -in the meantime- `QwtPlotItem.setIcon` and `QwtPlotItem.icon` methods have
also been removed in PythonQwt V0.14.3.

Code relying on this feature should thus be updated to use the new `get_icon_name`
method instead, i.e. `get_icon(item.get_icon_name())` instead of `item.icon()`.

0 comments on commit 22133e9

Please sign in to comment.