Merge pull request #1779 from manschloemark/master

Use fallback minStep in dec mode SpinBox (Issue 1756)
This commit is contained in:
Kenneth Lyons 2021-05-19 18:15:10 -07:00 committed by GitHub
commit bcb6a5d66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,7 @@ params = [
{'name': 'Units + SI prefix', 'type': 'float', 'value': 1.2e-6, 'step': 1e-6, 'siPrefix': True, 'suffix': 'V'},
{'name': 'Limits (min=7;max=15)', 'type': 'int', 'value': 11, 'limits': (7, 15), 'default': -6},
{'name': 'Int suffix', 'type': 'int', 'value': 9, 'suffix': 'V'},
{'name': 'DEC stepping', 'type': 'float', 'value': 1.2e6, 'dec': True, 'step': 1, 'siPrefix': True, 'suffix': 'Hz'},
{'name': 'DEC stepping', 'type': 'float', 'value': 1.2e6, 'dec': True, 'step': 1, 'minStep': 1.0e-12, 'siPrefix': True, 'suffix': 'Hz'},
]},
{'name': 'Save/Restore functionality', 'type': 'group', 'children': [

View File

@ -224,6 +224,10 @@ class SpinBox(QtGui.QAbstractSpinBox):
if 'format' not in opts:
self.opts['format'] = asUnicode("{value:d}{suffixGap}{suffix}")
if self.opts['dec']:
if self.opts.get('minStep') is None:
self.opts['minStep'] = self.opts['step']
if 'delay' in opts:
self.proxy.setDelay(opts['delay'])