PDA

View Full Version : [QTextEdit] Delete single lines



bmn
18th July 2012, 11:59
Hi there,

I need to delete some (one or multiple) lines in a QTextEdit. The only thing I found is QTextEdit::clear which deletes all lines, but that's not what I want. I need a more direct access to edit/delete a single line but neither QTextEdit nor QTextDocument seem to provide an interface for that.
How am I supposed to do that?

sedi
18th July 2012, 15:16
Does this link (http://stackoverflow.com/questions/10417795/remove-a-line-block-from-qtextedit) help?

bmn
18th July 2012, 16:52
Does this link (http://stackoverflow.com/questions/10417795/remove-a-line-block-from-qtextedit) help?

Depends. I need to process a lot of text and the link uses functions intended for user interaction to delete the text. Is that efficient? I think it is, though. Thanks!

wysota
18th July 2012, 16:57
It does not use functions for user interaction. It's a correct approach.