[SOLVED] Media Player time
-
Hello, I am trying to get current time of song playing and I tried to get through slider... I got the time but its not accurate... It always late 2 seconds...
I tested with a song that is long 1:17... Song supposed to end when "current time label" reach 1:17, but it always end when "current time label" reach 1:15... "Current time label" is 2 seconds behind the real time...Thats how I did that...
@String newtime;
int vals = ui->posSlider->value();
int hourss = vals/(10006060);
int minutess = (vals-(hourss10006060))/(100060);
int secondss = (vals-(minutess100060)-(hours100060*60))/1000;newtime.append(QString( "%1" ).arg(minutess, 2, 10, QLatin1Char('0')) + ":" +
QString( "%1" ).arg(secondss, 2, 10, QLatin1Char('0')));
ui->label_3->setText(newtime);@