Add QmlControlProxy::trigger()#15420
Conversation
…hot QTimer for value resetting after event loop processing. Replaced the existing hardcoded trigger function in Sampler.qml by calling the new method.
|
IMO it would be better if |
311b316 to
bd6306f
Compare
@acolombier wrote in #14849 (comment) that both states are important for property binding. Therefore I implemented it this way. |
|
I believe you might be able to also emit the two signals back to back so they both get addressed in the eventloop, in case you don't want to use the timer. Thanks for looking into this! <3 |
Right, thanks for the pointer. I still didn't find a way where this was actually required. I can only find this used for the "eject" control. mixxx/src/widget/wtrackmenu.cpp Lines 2571 to 2572 in 3c35370 IMO we should first fix the eject CO behavior and then see if the double value in the event loop is required anywhere else. I think the primary issue stems from the fact that "eject" is set up as |
|
AFAIS, this snippet would indeed induce two consecutive emits (one for So in theory, you should be able to remove the |
We've also mixxx/res/controllers/common-controller-scripts.js Lines 265 to 271 in 6adb012 Which is used for many other controls: Why do you think this is specific for "eject" ? |
acolombier
left a comment
There was a problem hiding this comment.
Thanks again for looking into this. I tested locally to see if we could get this to work without the timer and it seems to works great.
Co-authored-by: Antoine Colombier <7086688+acolombier@users.noreply.github.com>
c95588c to
d7816a3
Compare
acolombier
left a comment
There was a problem hiding this comment.
LGTM - thanks for addressing this!
This PR adds a trigger method to QmlControlProxy. This is using a single shot timer with zero interval, to ensure that both updates (1 then 0) will correctly be reported to the CO slots, as two seperate events in the event loop.