My Text Scolling class



  • Hi all I have a class for text scrolling. At the time the text reaches the end of his long and starts from the beginning. But I am unable to restart the text before the end of the text:
    @
    text
    xt te
    t tex
    @
    Can anyone view the class?

    http://www.2shared.com/file/YUbxQzyA/WidgetMarqueeLabel.html

    thanks



  • I think that i must modified this function:

    @void WidgetMarqueeLabel::paintEvent(QPaintEvent *evt) //fai ogni volta che c'è l'evento repaint
    {
    QPainter p(this);
    QPainter p2(this);
    if(direction==RightToLeft)
    {
    px -= speed;
    px2 -= speed;

            if (px <= (-textLength)){
                px = width();
                }
    
            if (px2 <= (-textLength)){
                px2 = width();
                }
    

    }
    else
    {
    px += speed;
    if(px >= width())
    px = - textLength;
    }
    p.drawText(px, py+fontPointSize, text()); // disegna il testo alle coordinate px, py+fontPointSize
    p.translate(px,0);
    p2.drawText(px2,py+fontPointSize, text());
    p2.translate(px2,0);@

    but not work :(


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.