c++ - Compare QTime and QTimer values -


i call function after x seconds , after y seconds etc.. number of seconds wait before calling function stored in qtime

i thought launching timer , when value of qtimer has value of 1 of qtime, call function, dont' know @ how ..

here idea in "pseudo-code" :

qtime time1(0, 0, 10); // 00:00:10 qtime time2(0, 0, 15); // 00:00:15  // init qtimer  if (qtimer.value == time1.value)     function1(); if (qtimer.value == time2.value)     function2(); 

how can ?

thanks help

the easiest way use 2 qtimer objects, each interval respective function.

another option single timer fires @ rate of lowest common denominator, in case 5 seconds, , call each function @ appropriate count. i.e. function1 every second timeout, function2 every third timeout.

another option calculate time until next event , start timer interval.


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -