Migrating from version 2 to version 3

The main change between version 2 and version 3 is the basic plotting library on which guiqwt is based on:

  • guiqwt version 2: depends on PyQwt, the Python bindings to Qwt C++ library – only supports PyQt4.
  • guiqwt version 3: depends on PythonQwt, a new library written from scratch to continue supporting Qwt API through a pure Python reimplementation of its main classes (QwtPlot, QwtPlotItem, QwtPlotCanvas, ...) – supports PyQt4, PyQt5 and PySide (PySide support is theoretical: not tested).

Another major change is the switch from old-style to new-style signals and slots. The guiqwt.signals module is now empty because it used to collect strings for old-style signals: however, it still contains documentation on available signals.

Examples

Switching from PyQwt to PythonQwt in your code:

from PyQt4.Qwt5 import QwtPlot  # PyQwt (supports only PyQt4)

from qwt import QwtPlot  # PythonQwt (supports PyQt4, PyQt5 and eventually PySide)

Switching from guiqwt 2 to guiqwt 3:

plot = get_plot_instance()  # plot is a QwtPlot instance

## guiqwt 2:
from guiqwt.signals import SIG_ITEM_MOVED
plot.connect(plot, SIG_ITEM_MOVED, item_was_moved)

## guiqwt 3:
plot.SIG_ITEM_MOVED.connect(item_was_moved)