Example here :
https://github.com/obiwankennedy/rol...ayerwidget.cpp
connect(&m_player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChanged(qint64)));
connect(&m_player,SIGNAL(positionChanged(qint64)),this,SLOT(positionChanged(qint64)));
To copy to clipboard, switch view to plain text mode
and
void PlayerWidget::positionChanged(qint64 time)
{
QTime displayTime
(0,
(time / 60000) % 60,
(time / 1000) % 60);
if((!m_preferences->value("isPlayer",false).toBool()) && ((time>m_time+(FACTOR_WAIT*m_player.notifyInterval()))||(time<m_time)))
{
emit playerPositionChanged(m_id,time);
}
m_time = time;
m_ui->m_timeSlider->setValue(time);
m_ui->m_timerDisplay->display(displayTime.toString("mm:ss"));
}
void PlayerWidget::positionChanged(qint64 time)
{
QTime displayTime(0, (time / 60000) % 60, (time / 1000) % 60);
if((!m_preferences->value("isPlayer",false).toBool()) && ((time>m_time+(FACTOR_WAIT*m_player.notifyInterval()))||(time<m_time)))
{
emit playerPositionChanged(m_id,time);
}
m_time = time;
m_ui->m_timeSlider->setValue(time);
m_ui->m_timerDisplay->display(displayTime.toString("mm:ss"));
}
To copy to clipboard, switch view to plain text mode
In fact, there is an issue about the type. You have to put a slot in the middle.
Bookmarks