Which Widget to use to display simple text lines?
-
Hi,
I need a Widget to display a number of simple text lines.
There should be no scrolling.
I do not need to edit the text.
It would be nice if I could control line spacing such that a fixed number of lines fits the size of the Widget.Is there a Widget suitable for this?
Or should I draw the strings myself on some canvas or so? -
Isn't QTextView obsolete? I only see the QTextEdit and I do not need edit functionality. I'm afraid this will slow down drawing.
-
Isn't QTextView obsolete? I only see the QTextEdit and I do not need edit functionality. I'm afraid this will slow down drawing.
@Simmania said in Which Widget to use to display simple text lines?:
I only see the QTextEdit and I do not need edit functionality. I'm afraid this will slow down drawing.
An editable widget will only affect drawing while being edited. For QTextEdit you can turn off editing. As long as all your text lines fit on a normally sized screen you don't need to worry about performance much. Most likely there are some tricks to calculate line spacing and apply it to a QTextEdit. But, like others already said, QLabels in a QVBoxLayout are much easier to handle and implement.