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. Android soft keyboard action button
QtWS25 Last Chance

Android soft keyboard action button

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
imeoptionsandroidspinboxdialog
5 Posts 4 Posters 2.4k 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
    morte
    wrote on 2 Nov 2015, 14:14 last edited by morte 11 Jun 2015, 20:47
    #1

    There is Dialog (from Qt.Quick Dialogs) with few SpinBoxes, when user edit an SpinBox value then press 'Done' button (on Android software keyboard) whole Dialog closes.
    How can i replace 'Done' with 'Next' keyboard action button on or change that behavior?

    1 Reply Last reply
    1
    • 2 Offline
      2 Offline
      2605imp
      wrote on 11 Jan 2016, 14:14 last edited by
      #2

      Did you find a solution to this as I have the same requirement ?
      In a Java app you would include in the XML:
      android:imeOptions="actionNext"

      1 Reply Last reply
      0
      • S Offline
        S Offline
        seyed
        wrote on 11 Mar 2017, 09:23 last edited by
        #3

        Same problem too :/

        1 Reply Last reply
        0
        • S Offline
          S Offline
          seyed
          wrote on 28 May 2020, 20:31 last edited by seyed
          #4

          OK! I solved it as follow in Qt 5.12:

          import QtQuick 2.12
          import QtQuick.Controls 2.12
          
          Column {
              TextField {
                  id: field1
                  KeyNavigation.tab: field2    //<--- what is next element?
                  activeFocusOnTab: true    //<--- I want use tab key for desktop version 
                  EnterKey.type: Qt.EnterKeyNext    //<--- change 'done' label to 'next' 
                  Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus();    //<--- focus next element same as tab key does
              }
              TextField {
                  id: field2
                  KeyNavigation.tab: field3
                  activeFocusOnTab: true
                  EnterKey.type: Qt.EnterKeyNext 
                  Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus();
              }
              TextField {
                  id: field3
                  KeyNavigation.tab: field1
                  activeFocusOnTab: true
                  EnterKey.type: Qt.EnterKeySend    //<--- change label of return key of the soft keyboard as 'send'
                  Keys.onReturnPressed: sendData();    //<--- finally send data if user pressed done button (return button)
              }
          }
          

          NOTE: Action button of the Android soft keyboard is same as return button which you can control it in XML layout file with 'imeOptions' attribute.

          A 1 Reply Last reply 12 Mar 2021, 14:48
          1
          • S seyed
            28 May 2020, 20:31

            OK! I solved it as follow in Qt 5.12:

            import QtQuick 2.12
            import QtQuick.Controls 2.12
            
            Column {
                TextField {
                    id: field1
                    KeyNavigation.tab: field2    //<--- what is next element?
                    activeFocusOnTab: true    //<--- I want use tab key for desktop version 
                    EnterKey.type: Qt.EnterKeyNext    //<--- change 'done' label to 'next' 
                    Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus();    //<--- focus next element same as tab key does
                }
                TextField {
                    id: field2
                    KeyNavigation.tab: field3
                    activeFocusOnTab: true
                    EnterKey.type: Qt.EnterKeyNext 
                    Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus();
                }
                TextField {
                    id: field3
                    KeyNavigation.tab: field1
                    activeFocusOnTab: true
                    EnterKey.type: Qt.EnterKeySend    //<--- change label of return key of the soft keyboard as 'send'
                    Keys.onReturnPressed: sendData();    //<--- finally send data if user pressed done button (return button)
                }
            }
            

            NOTE: Action button of the Android soft keyboard is same as return button which you can control it in XML layout file with 'imeOptions' attribute.

            A Offline
            A Offline
            ATatum_BlurPD
            wrote on 12 Mar 2021, 14:48 last edited by
            #5

            Thanks so much for posting this result!
            This worked for me in QT 5.14.2

            @seyed said in Android soft keyboard action button:

            NOTE: Action button of the Android soft keyboard is same as return button which you can control it in XML layout file with 'imeOptions' attribute.

            Can you elaborate on this?

            I'm working on Android and am not seeing the 'Done' button changing as expected, but I do see in the QT Docs:

            Note: Not all of these values are supported on all platforms. For unsupported values the default key is used instead.

            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