Example #1
0
void KNScrollLabel::resizeEvent(QResizeEvent *event)
{
    //Update the widget size.
    QWidget::resizeEvent(event);
    //Update the animation parameter.
    updateAnimeParameters();
}
Example #2
0
void KNScrollLabel::setText(const QString &text)
{
    //Stop all the previous timer first.
    stopTimers();
    //Reset all the moving direction.
    m_movingLeft=true;
    //Save the text data.
    m_text=text;
    //Update animation parameters.
    updateAnimeParameters();
    //Update the text data.
    update();
}
Example #3
0
void KNScrollLabel::resizeEvent(QResizeEvent *event)
{
    QWidget::resizeEvent(event);
    //Update the animations.
    updateAnimeParameters();
    //Check is it still need to scroll, here's a hack:
    //If the left most is 0, means no need to move.
    if(m_leftMostX==0)
    {
        //Just stop all timer and repaint.
        stopAllTimer();
        m_textX=m_glowRadius/4;
        update();
    }
}
Example #4
0
void KNScrollLabel::setText(const QString &text)
{
    //Stop timers before.
    stopAllTimer();
    //Reset moving direction and position parameters.
    m_movingLeft=true;
    m_textX=m_glowRadius/4;
    //Reset the Timer.
    m_waiting->setInterval(5000);
    //Set datas.
    m_text=text;
    //Update animation parameters.
    updateAnimeParameters();
    //Update viewport.
    update();
}