I have class which inherits QTabWidget
. Inside the generated tab I want to display some text.The text should not be editable by the user.But during the application execution there can be a case/s which will cause the text change. Which class should I use for text? Thought about QTextEdit
- but it doesn`t look like best idea - since the user should not change the text.Also thought about QLabel
- but it also is not good - since the application displays text not label.
Asked
Active
Viewed 524 times
0

YAKOVM
- 9,805
- 31
- 116
- 217
1 Answers
1
QTextEdit
can be set to read-only with its property readOnly
. I use QTextEdit
to display a long read-only text, because it can scroll. I also have read-write text, and by choosing the same widget for all long text, my user interface looks even.
http://qt-project.org/doc/qt-4.8/qtextedit.html#readOnly-prop
An other alternative is QWebView
if you plan to have complexly formatted text.

Eike
- 2,205
- 17
- 10
-
Sо why it better then QtextLabel? – YAKOVM Apr 15 '13 at 09:11
-
1Does `QTextLabel` even exist? I can't find it in the QT docs. However `QLabel` can't scroll IMHO, and by default looks different than `QTextEdit`. But there is no specific downside to displaying text with a `QLabel`. – Eike Apr 15 '13 at 09:16