Fix parametertree sending bad options to spinbox

This commit is contained in:
Luke Campagnola 2016-12-06 22:56:55 -08:00
parent 6b798ffed8
commit 65e9052580
1 changed files with 7 additions and 2 deletions

View File

@ -279,9 +279,14 @@ class WidgetParameterItem(ParameterItem):
## If widget is a SpinBox, pass options straight through
if isinstance(self.widget, SpinBox):
# send only options supported by spinbox
sbOpts = {}
if 'units' in opts and 'suffix' not in opts:
opts['suffix'] = opts['units']
self.widget.setOpts(**opts)
sbOpts['suffix'] = opts['units']
for k,v in opts.items():
if k in self.widget.opts:
sbOpts[k] = v
self.widget.setOpts(**sbOpts)
self.updateDisplayLabel()