Fix parametertree sending bad options to spinbox
This commit is contained in:
parent
6b798ffed8
commit
65e9052580
@ -279,9 +279,14 @@ class WidgetParameterItem(ParameterItem):
|
|||||||
|
|
||||||
## If widget is a SpinBox, pass options straight through
|
## If widget is a SpinBox, pass options straight through
|
||||||
if isinstance(self.widget, SpinBox):
|
if isinstance(self.widget, SpinBox):
|
||||||
|
# send only options supported by spinbox
|
||||||
|
sbOpts = {}
|
||||||
if 'units' in opts and 'suffix' not in opts:
|
if 'units' in opts and 'suffix' not in opts:
|
||||||
opts['suffix'] = opts['units']
|
sbOpts['suffix'] = opts['units']
|
||||||
self.widget.setOpts(**opts)
|
for k,v in opts.items():
|
||||||
|
if k in self.widget.opts:
|
||||||
|
sbOpts[k] = v
|
||||||
|
self.widget.setOpts(**sbOpts)
|
||||||
self.updateDisplayLabel()
|
self.updateDisplayLabel()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user