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. Why is setPreeditText not directly available in QML?

Why is setPreeditText not directly available in QML?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 462 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.
  • U Offline
    U Offline
    urgm_t
    wrote on last edited by urgm_t
    #1

    Hi,

    I have been trying to use the setPreeditText function in QML to set preedit text dynamically for my virtual keyboard implementation. However, when I call setPreeditText from QML (e.g., InputContext.setPreeditText()), I receive the following error:

    Property 'setPreeditText' of object QVirtualKeyboardInputContext(xxxxxxx) is not a function
    

    Could you please clarify:

    • Is setPreeditText not exposed in QML?
    • Is there any official documentation or Qt design guideline that explicitly mentions this limitation?
    • If possible, could you share the recommended way to dynamically set preedit text in QML? I would greatly appreciate any suggestions.

    Thank you for your time and help!

    1 Reply Last reply
    0
    • U Offline
      U Offline
      urgm_t
      wrote on last edited by
      #2

      I found that the InputContext object in QML does not have a setPreeditText function. This method is only available in the C++ QInputMethodEvent class.
      QML: https://doc.qt.io/qt-5/qml-qtquick-virtualkeyboard-inputcontext.html
      C++: https://doc.qt.io/qt-5/qvirtualkeyboardinputcontext.html

      Below are my remaining questions:

      • Is there any official documentation or Qt design guideline that explicitly mentions this limitation?
      • If possible, could you share the recommended way to preedit text in QML?
      1 Reply Last reply
      0
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by
        #3

        According to the documentation, https://doc.qt.io/qt-5/qml-qtquick-virtualkeyboard-inputcontext.html#preeditText-prop:

        preeditText : string

        This property sets the pre-edit text.

        The property isn't marked read-only, indicating that an application can assign to it.

        Asking a question about code? http://eel.is/iso-c++/testcase/

        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