Hi,
I have a slider with valueChanged signal connecting to a quick computation.
When I move the slider crazily fast. I have to call QCoreApplication:rocessEvents() to immediately update the slider movement, then emit valueChanged.
The computation can't catch up the speed and not all valueChanged's are received.
However, when I stop sliding, it starts to process those singals and end up the last slider value doesn't much the computation result.
For instance, I finally stop at value 53, but the computation process the previous missed signal, such as 32. So the last input slider value doesn't match the computation.
How can I solve this problem?
Thanks!
Hi,
I have a slider with valueChanged signal connecting to a quick computation.
When I move the slider crazily fast. I have to call QCoreApplication:rocessEvents() to immediately update the slider movement, then emit valueChanged.
The computation can't catch up the speed and not all valueChanged's are received.
However, when I stop sliding, it starts to process those singals and end up the last slider value doesn't much the computation result.
For instance, I finally stop at value 53, but the computation process the previous missed signal, such as 32. So the last input slider value doesn't match the computation.
How can I solve this problem?
Thanks!
Added after 24 minutes:
It looks like I solve it!
In computation, I did
Qt Code:
if ( slider->value() != value ) { return; }To copy to clipboard, switch view to plain text mode
Wonder if this is the right way...
Bookmarks