Re: Smooth Text Scrolling
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.
Re: Smooth Text Scrolling
Thanks Lykurg, I ended up creating a simple QWidget and using scroll() as you suggested. Works like a charm :-)
Re: Smooth Text Scrolling
can u please post ur code
Re: Smooth Text Scrolling
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
Re: Smooth Text Scrolling
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.
Re: Smooth Text Scrolling
i solved the problem by using a Qtextedit widget which provided hori and vert scroll bars 'as nedded'
thx
Re: Smooth Text Scrolling
Quote:
Originally Posted by
Lykurg
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.
I want to make a label that contains rich text ,but the text is larger than the label size.
So, I need to have a scroll bar with the label.
How can I " alter QLabel and use QWidget::scroll() with a timer " ??
I don't understand how to implement this :(
Re: Smooth Text Scrolling
Quote:
Originally Posted by
Marwa Shams
So, I need to have a scroll bar with the label.
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.
Re: Smooth Text Scrolling
Quote:
Originally Posted by
Lykurg
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.
Thank you very much :)
Re: Smooth Text Scrolling
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??:confused:
Re: Smooth Text Scrolling
for the original post: scrolling text like a banner with Qlabel.
go here for some answers.
another qt centre post