Fix: Parameter tree ignores user-set 'expanded' state#1175
Fix: Parameter tree ignores user-set 'expanded' state#1175j9ac9k merged 6 commits intopyqtgraph:developfrom
Conversation
When setting the 'expanded' state of parameters, this change is not applied in the graphically visible tree. This commit changes that behaviour by adding a clause in `ParameterItem.optsChanged` to react to that. Fixes pyqtgraph#1130
|
While we're at it, is there a similar action to take on the other options, e.g., "enabled" (I've wanted this in the past), "readonly" (maybe useful), "renamable", "strictNaming", and (maybe?!) "type"? Also, I think the same should be applied to |
|
(Also, this is great, thanks!) |
|
@jaxankey You are right, there is something fundamentally wrong with the update mechanism. I was not aware that there are that many properties that are not handled on update. I will have a look at this tomorrow or the day after, that definitely needs to be fixed. |
|
Yeah, there are more than I listed, too, e.g., 'tip'. Note this seems to fix |
|
(And I can't find a signal that triggers when an expand happens. But I give up for today.) |
|
@jaxankey The inverse problem will actually be more difficult to solve: If states are synced with the fundamental |
As seen in pyqtgraph#1130, there is interest in synchronizing the "expanded" state of `Parameter`s in `ParameterTree`s. As a default, this would lead to users being forced to always have multiple `ParameterTree`s to be expanded in the exact same way. Since that might not be desirable, this commit adds an option to customize whether synchronization of the "expanded" state should happen.
…rTrees Currently, `Parameter` options `renamable` and `removable` are only considered when building a new `ParameterTree`. This commit makes changes in those options reflected in the corresponding `ParameterItem`s.
|
@jaxankey Made three changes, namely:
Additionally, since changing For the other parameters:
|
|
@2xB I merged another PR a bit ago, which appears to have caused some conflicts with your branch. Would you mind resolving those, which should trigger another CI run (which I was about to do anyway). Thanks. |
|
@2xB I accidentally merged a PR that broke the |
|
That Anyway, now that the dev build is failing this test, now your PR is going to show that test failing regardless of your code change (until I merge #1215) |
|
Retriggering CI |
|
Green across the board 🎊 Merging, thanks for the PR @2xB |
This issue was introduced in merging develop into pyqtgraph#1175. While refactoring for the merge, the change in namespace was not correctly attributed, leading to the parameter `opts` to be assumed in local namespace when it isn't.
When setting the 'expanded' state of parameters, this change is not applied
in the graphically visible tree. This commit changes that behaviour by
adding a clause in
ParameterItem.optsChangedto react to that.Also, an old and trivial out-commented debugging code line is removed.
Fixes #1130