Merge pull request #673 from campagnola/int-parameter-format

Change integer parameter formatting
This commit is contained in:
Luke Campagnola 2018-04-25 15:39:35 -07:00 committed by GitHub
commit 888ed6d55f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,9 @@ pyqtgraph-0.11.0 (in development)
To mimic the old behavior, use ArrowItem.rotate() instead of the `angle` argument.
- Deprecated graphicsWindow classes; these have been unnecessary for many years because
widgets can be placed into a new window just by calling show().
- Integer values in ParameterTree are now formatted as integer (%d) by default, rather than
scientific notation (%g). This can be overridden by providing `format={value:g}` when
creating the parameter.
pyqtgraph-0.10.0

View File

@ -105,6 +105,7 @@ class WidgetParameterItem(ParameterItem):
if t == 'int':
defs['int'] = True
defs['minStep'] = 1.0
defs['format'] = '{value:d}'
for k in defs:
if k in opts:
defs[k] = opts[k]