View Full Version : visible text of textedit

25th June 2006, 22:22

I'm having a lot of trouble finding a way to show the visible text of a qtextedit on a qlabel that I use as preview.
In my application I have a qtextedit and a qlabel in a horizontal layout. I use the textedit to put text in that is to be formatted as html. Every time the text changes of the textedit I call a function called setPreview() wich shows the text of the textEdit on the label. The problem arises when the text is too big to fit in the textedit. Then the textedit gets scrollpanes, but when I scroll the text the preview remains the same. So I was thinking of a way to get to the visible text in the textedit to show it in the preview.
Hope it doesn't get too confusing :o


25th June 2006, 23:02
Maybe you should use another QTextEdit then? You can make it read-only using QTextEdit::setReadOnly().

26th June 2006, 08:50
That is no option for this qtextedit as it serves as a inputwidget for making up html, a kind of dreamweaver code panel. The user should be able to change the text on the qtextedit.

Thanks for replying

26th June 2006, 10:02
... or did you mean I should use another qtextedit as previewwidget? ... I might try that.. thanks