dsyleixa123
Posts: 1437
Joined: Mon Jun 11, 2018 11:22 am

qt5 creator: change updateTimer during runtime?

Thu May 13, 2021 4:18 pm

I currently use an updateTimer by update-time 100ms:
updateTimer.start(100);

that works as expected.
Now I want to change the update time during runtime to make updating (e.g., computing values and drawing some graphs) faster or slower (e.g., in a range from 1ms to 200ms update time).
Now I want to get a user input from a slider widget (which also works already in that range, I can read the slider position) to change this update speed -

but how can I change the updateTimer interval by such a user input during runtime?


dsyleixa123
Posts: 1437
Joined: Mon Jun 11, 2018 11:22 am

Re: qt5 creator: change updateTimer during runtime?

Thu May 13, 2021 5:34 pm

aahh, you mean, calling again updateTimer.start(), but now from inside
mainWindow::updateTimer
itself, now using the new speed value updateTimer.start(speed);

ok, thanks, that seems to work 8)

Return to “C/C++”