Well I found another way to do this. Little bit long but works perfect.
qint64 duration = mediaPlayer.duration();
int seconds = (duration/1000) % 60;
int minutes = (duration/60000) % 60;
int hours = (duration/3600000) % 24;
QTime time(hours, minutes,seconds);
ui->lblDuration->setText(time.toString());
Here I have used to qint64 as variable type so I don't need to convert float to integer (I have used float value in my question).
I have used remainders values to set seconds,minutes and hours.
Example: in hours, I have devided duration in 3600000. Which means hours(60) * minutes(60) * milliseconds(1000). Which gives me exact hours and then get the remainder of 24(days) because to make sure there are not days. (which is really not possible for a video but to make sure).
Then converting them to Qtime (because I need this in "hh:mm:ss" format). Later convert to string and displayed using a label.