Results 1 to 2 of 2

Thread: Is it possible to set a maximum length for QTextEdit ???

  1. #1
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Is it possible to set a maximum length for QTextEdit ???

    Hello folks,

    Is it possible to set a maximum length for QTextEdit....?

    We have setMaxLength method for QLineEdit... I need a similar functionality for QTextEdit.

    Regards

  2. #2
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Is it possible to set a maximum length for QTextEdit ???

    Perhaps you could connect the QTextEdit::textChanged() signal to a slot that keeps count of how many characters there are and calls setEnabled(false) or something like that when the counter's value exceeds some threshold.

Similar Threads

  1. QTextEdit - how to limit maximum length?
    By Henrikas[MI] in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2010, 20:38
  2. Set Maximum Length of QTextEdit
    By moh.gup@gmail.com in forum Qt Programming
    Replies: 3
    Last Post: 2nd July 2010, 08:27
  3. Replies: 33
    Last Post: 10th June 2010, 16:51
  4. Maximum input length for QTextEdit or QPlainTextEdit ??
    By b_ginner in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2009, 20:57
  5. qt4 & xp - QTextEdit length
    By incapacitant in forum Newbie
    Replies: 4
    Last Post: 6th March 2006, 15:34

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.