Results 1 to 2 of 2

Thread: How to limit the lines displayed in qtextedit or qplaintextedit ?

  1. #1
    Join Date
    Aug 2013
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to limit the lines displayed in qtextedit or qplaintextedit ?

    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 !!!

  2. The following user says thank you to johnson604 for this useful post:


  3. #2
    Join Date
    Oct 2013
    Posts
    41
    Thanks
    1
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to limit the lines displayed in qtextedit or qplaintextedit ?

    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.

  4. The following user says thank you to sulliwk06 for this useful post:


Similar Threads

  1. Replies: 7
    Last Post: 4th February 2013, 14:58
  2. QTextEdit - how to limit maximum length?
    By Henrikas[MI] in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2010, 21:38
  3. margins in QTextEdit/QPlainTextEdit
    By corrado in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2010, 10:35
  4. How to limit the input text in QPlaintextedit?
    By sudhansu in forum Qt Programming
    Replies: 4
    Last Post: 10th March 2010, 11:42
  5. Limit Amount of Text in a QTextEdit
    By johnmauer in forum Newbie
    Replies: 1
    Last Post: 10th January 2010, 17:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.