Add a proxy delay to checklist parameter changes via children edits#2097
Add a proxy delay to checklist parameter changes via children edits#2097j9ac9k merged 4 commits intopyqtgraph:masterfrom
Conversation
|
This is similar to how the SpinBox parameter (int/float) doesn't emit value changes until after the delay is reached. I just wasn't sure about hard-coding 1s delay, so I just made it an option. |
the parameter tree fixup PR added a new layer of children to the tree, which broke the 'lazy recurson' of the sigValueChanging logic. Now it is restored
|
Hi @ntjess I haven't worked w/ this much, but what is the issue that this solves? |
|
Same issue that is solved in spinbox. It lets individual check boxes act as sigValueChanging while valueChanged only fires when the user is done editing So you can toggle two boxes and "valueChanged" will only fire once |
|
Oh, so in this case, when you're checking the checkboxes, instead of running the function that's being called on each time it's checked as its checked, it waits a second to see if a user checks anything else, and then runs the slot that's connected to the |
|
Yep! Just like changing vs changed on a spinbox (waiting until the spinner is motionless for awhile) |
| @@ -1,5 +1,6 @@ | |||
| from ... import functions as fn | |||
| from ...Qt import QtWidgets | |||
| from ...Qt import QtWidgets, QtCore | |||
There was a problem hiding this comment.
Can we get rid of the QtCore import here?
- Remove unused import - Rename 'coalesceProxy' into something more meaningful
|
LGTM, thanks @ntjess for the PR! |
|
Looking at #2086 (comment), should this logic be changed to "when no child is focused" rather than "after 1 second"? |
|
I can see a case for being made for if lose focus, emit signal right away, else wait for the delay period. |
…yqtgraph#2097) * Add a proxy delay to checklist parameter changes via buttons * Intermediate checklist changes should be "valueChanging" * Bugfix: parameter tree now prints changing values the parameter tree fixup PR added a new layer of children to the tree, which broke the 'lazy recurson' of the sigValueChanging logic. Now it is restored * Minor refactoring of checklist - Remove unused import - Rename 'coalesceProxy' into something more meaningful
Randomly testing with a touchpad I found 1s proxy delay was usually adequate. Input from others would be nice on this
checklist-demo.mp4
.