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. [Solved?] Getting text including "preedit" from qt-components TextArea [MeeGo / N950]
Qt 6.11 is out! See what's new in the release blog

[Solved?] Getting text including "preedit" from qt-components TextArea [MeeGo / N950]

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.3k 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.
  • T Offline
    T Offline
    theoriginalgri
    wrote on last edited by
    #1

    Anyone knows a quick way to get the text including the preedit text when using the virtual keyboard on the n950?

    Following code
    @
    TextArea {
    onTextChanged: {
    console.log("Text:", text);
    }
    }
    @

    Returns this:
    @
    Text:
    Text:
    Text:
    Text:
    Text: Test
    @

    When entering "Test" with the virtual keyboard on the N950. I need to know how it can be done with the beta2 firmware, if this is already patched in an internal release, this does not help me now. I myself haven't found a way with the current sources.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      theoriginalgri
      wrote on last edited by
      #2

      Ok, I tried a bit and found a working solution. Maybe someone else has a better one and will find this to correct me :)

      Actual output when having "Hello world" in the TextArea and click after the first "o" and insert "123" with the virtual keyboard:
      @
      Text: Hello world
      Realtext: Hello world
      Text: Hello world
      Realtext: Hello world
      Text: Hello world
      Realtext: Hello 1 world
      Text: Hello world
      Realtext: Hello 12 world
      Text: Hello world
      Realtext: Hello 123 world
      @

      Code:
      @
      TextArea {
      id: textArea

      property string realText
      
      onTextChanged: {
          var tmp = text;
      
          if ( cursorPosition != -1 ) {
              tmp = tmp.substr(0, cursorPosition) + platformPreedit + tmp.substr(cursorPosition);
          }
      
          textArea.realText = tmp;
      
          console.log("Text:", text);
          console.log("Realtext:", realText);
      }
      

      }
      @

      1 Reply Last reply
      0
      • D Offline
        D Offline
        d2r2
        wrote on last edited by
        #3

        between any actions should textArea.deselect()

        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