Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QString MainWindow::getLengthCurrentMedia(qint64 current){
- QString sCurrent = "";
- QString sMinutes = "";
- QString sSeconds = "";
- current = current / 1000;
- int minutes = 0;
- int seconds = 0;
- minutes = current / 60;
- seconds = current % 60;
- if(minutes > 9){
- sMinutes = QString::number(minutes);
- }else{
- sMinutes = "0"+QString::number(minutes);
- }
- if(seconds > 9){
- sSeconds = QString::number(seconds);
- }else{
- sSeconds = "0"+QString::number(seconds);
- }
- sCurrent = sMinutes +":"+sSeconds;
- return sCurrent;
- //QMediaPlayer *player = new QMediaPlayer();
- //i used this function => getLengthCurrentMedia(player->duration());
- }
Advertisement
Add Comment
Please, Sign In to add comment