summaryrefslogtreecommitdiff
path: root/doc/source/sample_code
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/sample_code')
-rw-r--r--doc/source/sample_code/img/plotInteractiveImageROI.pngbin0 -> 564397 bytes
-rw-r--r--doc/source/sample_code/img/plotUpdateCurveFromThread.png (renamed from doc/source/sample_code/img/plotUpdateFromThread.png)bin62761 -> 62761 bytes
-rw-r--r--doc/source/sample_code/img/plotUpdateImageFromThread.pngbin0 -> 50938 bytes
-rw-r--r--doc/source/sample_code/index.rst53
4 files changed, 38 insertions, 15 deletions
diff --git a/doc/source/sample_code/img/plotInteractiveImageROI.png b/doc/source/sample_code/img/plotInteractiveImageROI.png
new file mode 100644
index 0000000..de62dc3
--- /dev/null
+++ b/doc/source/sample_code/img/plotInteractiveImageROI.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotUpdateFromThread.png b/doc/source/sample_code/img/plotUpdateCurveFromThread.png
index ac97ccd..ac97ccd 100644
--- a/doc/source/sample_code/img/plotUpdateFromThread.png
+++ b/doc/source/sample_code/img/plotUpdateCurveFromThread.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotUpdateImageFromThread.png b/doc/source/sample_code/img/plotUpdateImageFromThread.png
new file mode 100644
index 0000000..c0caec3
--- /dev/null
+++ b/doc/source/sample_code/img/plotUpdateImageFromThread.png
Binary files differ
diff --git a/doc/source/sample_code/index.rst b/doc/source/sample_code/index.rst
index 933d162..a5cbf11 100644
--- a/doc/source/sample_code/index.rst
+++ b/doc/source/sample_code/index.rst
@@ -142,7 +142,7 @@ Widgets
- .. image:: img/colormapDialog.png
:height: 150px
:align: center
- - This script shows the features of a :mod:`~silx.gui.plot.ColormapDialog`.
+ - This script shows the features of a :mod:`~silx.gui.dialog.ColormapDialog`.
:class:`silx.gui.plot.actions.PlotAction`
.........................................
@@ -208,14 +208,15 @@ Sample code that adds specific tools or functions to plot widgets.
- .. image:: img/plotWidget.png
:height: 150px
:align: center
- - This script shows how to subclass :class:`~silx.gui.plot.PlotWidget` to tune its tools.
+ - This script shows how to create a custom window around a PlotWidget.
- It subclasses a :class:`~silx.gui.plot.PlotWidget` and adds toolbars and
- a colorbar by using pluggable widgets:
+ It subclasses :class:`QMainWindow`, uses a :class:`~silx.gui.plot.PlotWidget`
+ as its central widget and adds toolbars and a colorbar by using pluggable widgets:
+ - :class:`~silx.gui.plot.PlotWidget` from :mod:`silx.gui.plot`
+ - QToolBar from :mod:`silx.gui.plot.tools`
- QAction from :mod:`silx.gui.plot.actions`
- QToolButton from :mod:`silx.gui.plot.PlotToolButtons`
- - QToolBar from :mod:`silx.gui.plot.PlotTools`
- :class:`silx.gui.plot.ColorBar.ColorBarWidget`
* - :download:`plotContextMenu.py <../../../examples/plotContextMenu.py>`
- .. image:: img/plotContextMenu.png
@@ -246,21 +247,43 @@ Sample code that adds specific tools or functions to plot widgets.
:align: center
- This script is an example to illustrate how to use axis synchronization
tool.
- * - :download:`plotUpdateFromThread.py <../../../examples/plotUpdateFromThread.py>`
- - .. image:: img/plotUpdateFromThread.png
+ * - :download:`plotUpdateCurveFromThread.py <../../../examples/plotUpdateCurveFromThread.py>`
+ - .. image:: img/plotUpdateCurveFromThread.png
:height: 150px
:align: center
- This script illustrates the update of a :mod:`silx.gui.plot` widget from a thread.
The problem is that plot and GUI methods should be called from the main thread.
- To safely update the plot from another thread, one need to make the update
- asynchronously from the main thread.
- In this example, this is achieved through a Qt signal.
-
- In this example we create a subclass of :class:`~silx.gui.plot.PlotWindow.Plot1D`
- that adds a thread-safe method to add curves:
- :meth:`ThreadSafePlot1D.addCurveThreadSafe`.
- This thread-safe method is then called from a thread to update the plot..
+ To safely update the plot from another thread, one need to execute the update
+ asynchronously in the main thread.
+ In this example, this is achieved with
+ :func:`~silx.gui.utils.concurrent.submitToQtMainThread`.
+
+ In this example a thread calls submitToQtMainThread to update the curve
+ of a plot.
+ * - :download:`plotUpdateImageFromThread.py <../../../examples/plotUpdateImageFromThread.py>`
+ - .. image:: img/plotUpdateImageFromThread.png
+ :height: 150px
+ :align: center
+ - This script illustrates the update of a :mod:`silx.gui.plot` widget from a thread.
+
+ The problem is that plot and GUI methods should be called from the main thread.
+ To safely update the plot from another thread, one need to execute the update
+ asynchronously in the main thread.
+ In this example, this is achieved with
+ :func:`~silx.gui.utils.concurrent.submitToQtMainThread`.
+
+ In this example a thread calls submitToQtMainThread to update the curve
+ of a plot.
+ * - :download:`plotInteractiveImageROI.py <../../../examples/plotInteractiveImageROI.py>`
+ - .. image:: img/plotInteractiveImageROI.png
+ :height: 150px
+ :align: center
+ - This script illustrates image ROI selection in a :class:`~silx.gui.plot.PlotWidget`
+
+ It uses :class:`~silx.gui.plot.tools.roi.RegionOfInterestManager` and
+ :class:`~silx.gui.plot.tools.roi.RegionOfInterestTableWidget` to handle the
+ interactive selection and to display the list of selected ROIs.
* - :download:`printPreview.py <../../../examples/printPreview.py>`
- .. image:: img/printPreview.png
:height: 150px