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 auto new line problem

TextArea auto new line problem

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    story1225
    wrote on last edited by
    #1

    Hi, I met a problem about TextArea.
    I created a qt quick application in QtCreater 3.1.2. In main.qml, I only add a TextArea control.
    I inputed some chinese words, where the cursor reached the TextArea.right , any more input will cause new input text going to new line.
    But if I only input text such as a~z,0~9 and so on , the TextArea will never change to new line.
    Is any one can help me ? Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leonardo.ramosantos
      wrote on last edited by
      #2

      Hi,

      Does it happen if you put some space characters? If don't, it happens because there is no way to know when to break a word or a number. So, Qt start a new line just when find a space character.

      []'s

      1 Reply Last reply
      0
      • S Offline
        S Offline
        story1225
        wrote on last edited by
        #3

        Thanks for reply!
        I did not put any space characters.
        I tested like this: first input one chinese word, than input some character 'a' untile the cursor reached the right end of the area. The result was all those 'a' appeared in the new line.
        I also tested input some space characters. It looks like Qt treated chinese words as space character.

        I only want to inputing texts auto breaking into new line when reach the right end of the textarea. Now I found the example in Qt examples at 'declarative\tutorials\gettingStarted\core\textArea.qml'

        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