Qt TextBrowser Horizontal Scrollbar

1.1k Views Asked by At

How do I make a horizontal scrollbar appear whenever the application is resized so that every line is as appears? Sometimes, filenames are really long and I don't want to manually resize the form UI.

I have tried setting the scrollbar policy to as needed, but that doesn't do anything. Since the lines are still appearing on the screen.

enter image description here

Increasing size of form:

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

You have to set the QTextEdit::LineWrapMode to QTextEdit::NoWrap.

ui->textBrowser->setLineWrapColumnOrWidth(QTextEdit::NoWrap); // or just '0'

See class reference for more details.