Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TextArea Limit on the number of symbols
Qt 6.11 is out! See what's new in the release blog

TextArea Limit on the number of symbols

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 176 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by Mikeeeeee
    #1

    Hi!
    How I can to do limit on the number of symbols from TextArea with QtQuick.Controls 2?
    It is work only to QtQuick.Controls 1 https://doc.qt.io/qt-5/qml-qtquick-controls-textarea.html#contentHeight-prop
    I only came up with this option:

                                onTextChanged: {
                                    if(textAreaSetTextAddQuestionLeftBottom.length > 400){
                                        console.log(textAreaSetTextAddQuestionLeftBottom.text)
                                        textAreaSetTextAddQuestionLeftBottom.text = textAreaSetTextAddQuestionLeftBottom.text.slice(0, 400)
                                    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved