Search code examples
c++qtqlineeditqscrollareaqscrollbar

Qt Creator (Designer): Single text line with horizontal scrollbar


How do I get a single text line with only a horizontal scollbar?

I think that's all there is to this question.

I've tried it with QLineEdit only or withing QScrollArea, with QTextEdit etc, and nothing was remotly close to working properly.

That's what I got so far:

enter image description here

It total it reads "Textexample", but the QLineEdit cuts it off and the QScrollArea doesn't provide a functional horizontal scrollbar.

In the end I'd like to have a single text line, with a horizontal scrollbar so with the scrollbar I can see everything that's inside the text line.

Thanks in advance. If more information is need, I'd be happy to help.


Solution

  • See the fat properties of the QTextEdit:

    enter image description here