PDA

View Full Version : time displayer not working in media player



qt_user
16th August 2010, 06:23
I havbe made a media player...... I have used the code of timer of "media Player " example of Qt but it is not working........ if anybody could tell me the cause,...........here's the code:



//In class VideoPlayer
connect(videoPlayerControls->slider,SIGNAL(valueChanged()),videoDisplayer,SLOT( updateTime()));

//In class VideoDisplayer
void VideoDisplayer::updateTime()
{
int msec = totalTime;
int sec = msec/1000;
int min = sec/60;
int hour = min/60;

QTime stopTime(hour%60, min%60, sec%60, msec%1000);

int currentTime = i*40;
msec = currentTime;
sec = msec/1000;
min = sec/60;
hour = min/60;
QTime playTime(hour%60, min%60, sec%60, msec%1000);
QString timeFormat = "m:ss";


if(hour > 0)
timeFormat = "h:mm:ss";
timeString = playTime.toString(timeFormat);
//timeString = "";
if(totalTime)
timeString += " / " + stopTime.toString(timeFormat);
localDisplayerTimeLabel->setText(timeString);
localDisplayerTimeLabel->show();
}


I have come to know about the problem..the updateTime function is not working...can anybody tell why is it so......as the slider is working correctly..