diff options
author | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
---|---|---|
committer | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
commit | cebdc9244c019224846cb8d2668080fe386a6adc (patch) | |
tree | aedec55da0f9dd4fc4d6c7eb0f58489a956e2e8c /silx/gui/plot/StatsWidget.py | |
parent | 159ef14fb9e198bb0066ea14e6b980f065de63dd (diff) |
New upstream version 0.9.0+dfsg
Diffstat (limited to 'silx/gui/plot/StatsWidget.py')
-rw-r--r-- | silx/gui/plot/StatsWidget.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/silx/gui/plot/StatsWidget.py b/silx/gui/plot/StatsWidget.py index a36dd9f..bb66613 100644 --- a/silx/gui/plot/StatsWidget.py +++ b/silx/gui/plot/StatsWidget.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2017 European Synchrotron Radiation Facility +# Copyright (c) 2017-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ Module containing widgets displaying stats from items of a plot. __authors__ = ["H. Payno"] __license__ = "MIT" -__date__ = "12/06/2018" +__date__ = "24/07/2018" import functools @@ -63,6 +63,8 @@ class StatsWidget(qt.QWidget): :param plot: the plot containing items on which we want statistics. """ + sigVisibilityChanged = qt.Signal(bool) + NUMBER_FORMAT = '{0:.3f}' class OptionsWidget(qt.QToolBar): @@ -151,6 +153,14 @@ class StatsWidget(qt.QWidget): self.setDisplayOnlyActiveItem = self._statsTable.setDisplayOnlyActiveItem self.setStatsOnVisibleData = self._statsTable.setStatsOnVisibleData + def showEvent(self, event): + self.sigVisibilityChanged.emit(True) + qt.QWidget.showEvent(self, event) + + def hideEvent(self, event): + self.sigVisibilityChanged.emit(False) + qt.QWidget.hideEvent(self, event) + def _optSelectionChanged(self, action=None): self._statsTable.setDisplayOnlyActiveItem(self._options.isActiveItemMode()) @@ -366,7 +376,7 @@ class StatsTable(TableWidget): self.setRowCount(0) # It have to called befor3e accessing to the header items - self.setHorizontalHeaderLabels(self._columns) + self.setHorizontalHeaderLabels(list(self._columns)) if self._statsHandler is not None: for columnId, name in enumerate(self._columns): @@ -539,7 +549,7 @@ class StatsTable(TableWidget): self._statsOnVisibleData = b self._updateCurrentStats() - def _activeItemChanged(self, kind): + def _activeItemChanged(self, kind, previous, current): """Callback used when plotting only the active item""" assert kind in ('curve', 'image', 'scatter', 'histogram') self._updateItemObserve() |