If it is only a label with text, I would do all the painting myself in a subclassed QLabel or even in a simple QWidget. Or you can alter QLabel and use QWidget::scroll() with a timer.
If it is only a label with text, I would do all the painting myself in a subclassed QLabel or even in a simple QWidget. Or you can alter QLabel and use QWidget::scroll() with a timer.
Jones (22nd April 2010)
Thanks Lykurg, I ended up creating a simple QWidget and using scroll() as you suggested. Works like a charm :-)
can u please post ur code
how can i do this (adding a scroll bar to a label) from Qt designer? I see that a scroll bar widget is available from Qt designer, still, no example or help is abailable ...
thanks
The tread wasn't about adding a scroll bar to a label, it was about using QWidget::scroll() which is a different case... What so you exactly want? I guess you are looking for QScrollArea with a QLabel inside.
marco.stanzani (15th March 2011)
i solved the problem by using a Qtextedit widget which provided hori and vert scroll bars 'as nedded'
thx
Then it is what I said to marco.stanzani: You are looking for QScrollArea. See the detailed description and you find an example on how to use it.
I already added the label to a scroll area ..
It works well that the scroll area has a scroll-bar vertical and horizontal
when the height and width of the label is larger than the height and width of the scroll area .......... BUT
the problem now with the label itself .. that the label doesn't expand its height depending on its content .
for example:- If the height is 20 pix then one line of text only appeared .. although there is another 3 lines that doesn't appear
So .. what is the way to make the label scaled to its content vertically??![]()
for the original post: scrolling text like a banner with Qlabel.
go here for some answers.
another qt centre post
Bookmarks