You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documenting some behavior changes to Parameter list types since 0.13.4.
Previously, it was possible to use values. Now limits must be used. (limits was added in 0.12.3)
Previously, it was possible to not specify value, the first value from limits would be used. Now if you don't specify it, the first value from limits will still be used butsigTreeStateChanged gets fired upon instantiation.
importpyqtgraphaspgimportpyqtgraph.parametertreeasptree## If anything changes in the tree, print a messagedefchange(param, changes):
print("tree changes:")
forparam, change, datainchanges:
print(' parameter: %s'%param.name())
print(' change: %s'%change)
print(' data: %s'%str(data))
print(' ----------')
params= [
# on 0.13.3, all four of the following work and callback doesn't fire# first two no longer work since 0.13.4# callback fires upon instantiation
{'name': 'List A', 'type': 'list', 'values': [1,2,3]},
{'name': 'List B', 'type': 'list', 'values': [1,2,3], 'value': 1},
# third one works on 0.13.4 but callback fires upon instantiation
{'name': 'List C', 'type': 'list', 'limits': [1,2,3]},
# fourth one works and doesn't fire a callback upon instantiation
{'name': 'List D', 'type': 'list', 'limits': [1,2,3], 'value': 1},
]
pg.mkQApp()
p=ptree.Parameter.create(name='params', type='group', children=params)
p.sigTreeStateChanged.connect(change)
t=ptree.ParameterTree()
t.setParameters(p, showTop=False)
t.show()
# don't need to run event loop# pg.exec()
The text was updated successfully, but these errors were encountered:
Documenting some behavior changes to Parameter
list
types since 0.13.4.values
. Nowlimits
must be used. (limits
was added in 0.12.3)value
, the first value fromlimits
would be used. Now if you don't specify it, the first value fromlimits
will still be used butsigTreeStateChanged
gets fired upon instantiation.The text was updated successfully, but these errors were encountered: