I've been trying to get the duration of a video file that's opened but whenever I open the file the duration always comes out to 00:00:00. I believe the logic and math are correct but that I am possibly missing a connection.
void MainWindow::updateDurationInfo(qint64 duration) {
int seconds = (duration/1000) % 60;
int minutes = (duration/60000) % 60;
int hours = (duration/3600000) % 24;
QTime time(hours, minutes,seconds);
ui->label->setText(time.toString()); }
updateDurationInfo(player->duration());