PDA

View Full Version : Scrolling text in a QLabel



prophet0
29th November 2011, 16:55
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

ChrisW67
29th November 2011, 22:30
You could look at example one from the first page of Google results (http://www.google.com/search?q=scrolling+QLabel):
http://www.youtube.com/watch?v=AirpRX5EPF4 which links to http://qt-apps.org/content/show.php/MarqueeLabel?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.

Lykurg
30th November 2011, 12:52
...also please search the forum. This question has been asked from time to time!