Results 1 to 3 of 3

Thread: Scrolling text in a QLabel

  1. #1
    Join Date
    Oct 2011
    Location
    Toronto Canada
    Posts
    97
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Scrolling text in a QLabel

    I have searched everywere but if im taking text from an xml file and then setting the text from xml but settext in a right to left scrolling

    how would i get that to work ?

    example moving in the direction of the arrow

    <------- My text here

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Scrolling text in a QLabel

    You could look at example one from the first page of Google results:
    http://www.youtube.com/watch?v=AirpRX5EPF4 which links to http://qt-apps.org/content/show.php/...content=113690

    Ultimately, you have to write code yourself

    Read an XML file with QXmlStreamReader or QDomDocument
    QLabel (or your own QWidget sub class) and QTimer are the essential components of the scrolling label. You could either try to fake it by left padding the string with spaces and successively removing them, or by overriding the QLabel paintEvent() function.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Scrolling text in a QLabel

    ...also please search the forum. This question has been asked from time to time!

Similar Threads

  1. Replies: 8
    Last Post: 30th September 2014, 10:00
  2. Smooth Text Scrolling
    By Jones in forum Newbie
    Replies: 11
    Last Post: 19th November 2011, 18:40
  3. scrolling text
    By dousdou in forum Qt Programming
    Replies: 9
    Last Post: 5th May 2011, 14:17
  4. Smooth text scrolling
    By francesco.frankie in forum Newbie
    Replies: 9
    Last Post: 29th November 2010, 22:16
  5. automatic scrolling text edit
    By Vash5556 in forum Newbie
    Replies: 2
    Last Post: 19th March 2007, 18:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.