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. Qt Virtual Keyboard and TextInput
Qt 6.11 is out! See what's new in the release blog

Qt Virtual Keyboard and TextInput

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 682 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.
  • DuBuD Offline
    DuBuD Offline
    DuBu
    wrote on last edited by
    #1

    Hi all,

    since the virtual keyboard has no ESC key or the like to cancel editing in a TextInput I tried to use the Qt.inputMethod.visible property to detect when a user closes the virtual keyboard without pressing the return key before. But unfortunately this signal gets emitted before the accept signal. So there's no way to differ a cancel from an accept by catching the Qt.inputMethod.visibleChanged signal.

    TextInput {
      id: textInput
      onAccepted: console.log("accepted")
    
      Connections {
        target: Qt.inputMethod
        onVisibleChanged: {
          console.log("inputMethodVisibleChanged:", target.visible)
        }
      }
    }
    

    Output:

    qml: inputMethodVisibleChanged: false
    qml: accepted
    

    Is there any other way to implement an editing canceled event?

    Regards

    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