PDA

View Full Version : How to limit the lines displayed in qtextedit or qplaintextedit ?



johnson604
3rd December 2013, 16:01
I'm going to display some information in my Qt appliction using QTextEdit or QPlainTextEdit. When there are too many lines in the widget, I want to delete the first line in the QTextEdit conponent. Can anyone help? Thank you !!!

sulliwk06
3rd December 2013, 18:59
Do you want to judge lines based on line wrap or by newline characters?

My guess is you're going to have to keep a track of the number of newline characters and then once you reach your limit erase from the start until you hit a newline.