summaryrefslogtreecommitdiff
path: root/silx/gui/plot/Profile.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/plot/Profile.py')
-rw-r--r--silx/gui/plot/Profile.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/silx/gui/plot/Profile.py b/silx/gui/plot/Profile.py
index ff85695..4a74fa7 100644
--- a/silx/gui/plot/Profile.py
+++ b/silx/gui/plot/Profile.py
@@ -31,6 +31,8 @@ __license__ = "MIT"
__date__ = "17/08/2017"
+import weakref
+
import numpy
from silx.image.bilinear import BilinearImage
@@ -348,7 +350,7 @@ class ProfileToolBar(qt.QToolBar):
title='Profile Selection'):
super(ProfileToolBar, self).__init__(title, parent)
assert plot is not None
- self.plot = plot
+ self._plotRef = weakref.ref(plot)
self._overlayColor = None
self._defaultOverlayColor = 'red' # update when active image change
@@ -443,6 +445,11 @@ class ProfileToolBar(qt.QToolBar):
self.getProfileMainWindow().sigClose.connect(self.clearProfile)
@property
+ def plot(self):
+ """The :class:`.PlotWidget` associated to the toolbar."""
+ return self._plotRef()
+
+ @property
@deprecated(since_version="0.6.0")
def browseAction(self):
return self._browseAction