2

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

Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71
  • 3
    I think you have to set the [LineWrapMode](http://qt-project.org/doc/qt-4.8/qtextedit.html#LineWrapMode-enum) to `QTextEdit::NoWrap`. – Kai Walz May 21 '14 at 06:21

1 Answers1

3

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

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

See class reference for more details.

Kai Walz
  • 786
  • 1
  • 5
  • 15