Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. My Text Scolling class
Forum Updated to NodeBB v4.3 + New Features

My Text Scolling class

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    enaud84
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • E Offline
      E Offline
      enaud84
      wrote on last edited by
      #2

      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 :(

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved