Now i do it this way:
Code: Select all
check_timer = new QTimer(this);
connect(check_timer, SIGNAL(timeout()), this, SLOT(check_state()));
check_timer->setInterval(1000); // 1 time per second
check_timer->start();
void myprogram::check_state()
{
if (_player->state() == 6 || _player->state() == 7) // if ended or error
{
_player->open(_media);
}
}