File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232Horizontal = QtCore .Qt .Orientation .Horizontal
3333
34- from contextlib import contextmanager
35-
36- @contextmanager
37- def suppress_signals (widget ):
38- widget .blockSignals (True )
39- try :
40- yield
41- finally :
42- widget .blockSignals (False )
4334
4435class Slider (QRangeSlider ):
4536
@@ -1008,9 +999,9 @@ def reset(self):
1008999 self .ismanual = np .zeros (0 , "bool" )
10091000
10101001 # -- set menus to default -- #
1011- with suppress_signals (self .RGBDropDown ):
1002+ with QtCore . QSignalBlocker (self .RGBDropDown ):
10121003 self .color = 'RGB'
1013- with suppress_signals (self .ViewDropDown ):
1004+ with QtCore . QSignalBlocker (self .ViewDropDown ):
10141005 self .view = 'image'
10151006 self .delete_restore ()
10161007
@@ -1517,7 +1508,7 @@ def update_plot(self):
15171508 for r in range (3 ):
15181509 # setValue on the slider triggers update_plot() so it needs to be suppressed
15191510 slider = self .sliders [r ]
1520- with suppress_signals (slider ):
1511+ with QtCore . QSignalBlocker (slider ):
15211512 slider .setValue ([
15221513 self .saturation [r ][self .currentZ ][0 ],
15231514 self .saturation [r ][self .currentZ ][1 ]
You can’t perform that action at this time.
0 commit comments