Results 1 to 3 of 3

Thread: Maximum input length for QTextEdit or QPlainTextEdit ??

  1. #1

    Question Maximum input length for QTextEdit or QPlainTextEdit ??

    Hello....
    Does anyone knows how to set up the maximun number of characters a QTextEdit can hold ?
    I mean, besides of installing a key eventFilter to count all the key pressed .....
    I wanna have an text input area for users but limit the length, including CR/LF, to 500 characters...

    Or if my direction is wrong... Please tell me.. this is going to drive me nuts...

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Maximum input length for QTextEdit or QPlainTextEdit ??

    there is QTextDocument::setMaximumBlockCount(), I am not aware of a character-limit;
    QLineEdit has one - but probably you want more than 1 line

  3. #3

    Default Re: Maximum input length for QTextEdit or QPlainTextEdit ??

    Quote Originally Posted by caduel View Post
    there is QTextDocument::setMaximumBlockCount(), I am not aware of a character-limit;
    QLineEdit has one - but probably you want more than 1 line
    Thanks caduel....
    But actually the concept of "Block" is not going to help here .. I already tried....
    The Block in QT means a "phrase" or a consecutive of character.
    So the effect MaximumBlockCount is not what I want.....

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

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.