Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problem with QML Android VirtualKeyBoard
Forum Updated to NodeBB v4.3 + New Features

Problem with QML Android VirtualKeyBoard

Scheduled Pinned Locked Moved Solved Mobile and Embedded
13 Posts 3 Posters 1.9k 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.
  • E Offline
    E Offline
    edoardo.videx
    wrote on last edited by
    #1

    Hi,i want create a Application for Android Mobile.
    I've a QML file where i want add a virtual keyboard. Everythings goes fine, but when i open the application the application output say:

    W/libQR_VIEWER_QML.so(22133): (null):0 ((null)): QQmlApplicationEngine failed to load component
    W/libQR_VIEWER_QML.so(22133): (null):0 ((null)): qrc:/main.qml:25 Type MainForm unavailable
    W/libQR_VIEWER_QML.so(22133): qrc:/MainForm.qml:47 Type MacBox unavailable
    W/libQR_VIEWER_QML.so(22133): qrc:/MacBox.qml:8 module "QtQuick.Virtualkeyboard" is not installed
    W/libQR_VIEWER_QML.so(22133):
    W/IInputConnectionWrapper(22133): showStatusIcon on inactive InputConnection
    

    PS.: I've a Qt5.11.2 version.

    Someone can help me??
    Thanks.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      The Virtual Keyboard module is not available on Android.

      It is possible to add it to the platform plugin though and not too hard. Search around, there are some folks who have done it already.

      (Z(:^

      E 1 Reply Last reply
      2
      • sierdzioS sierdzio

        The Virtual Keyboard module is not available on Android.

        It is possible to add it to the platform plugin though and not too hard. Search around, there are some folks who have done it already.

        E Offline
        E Offline
        edoardo.videx
        wrote on last edited by
        #3

        @sierdzio so, how can i use a keyboard in Android?

        If I want add a text line edit(or similar in QML,like TextInput or TextField) when I touch over the object for write something, not happen nothing!! Where's the mistake?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          By default, system keyboard is used on Android. So, when you set focus on TextIntput, your OS keyboard will show (GBoard, SwiftKey, Android Keyboard - whatever you have installed).

          If it does not work for you - well, I don't know. Show us your code, maybe we'll spot something.

          (Z(:^

          E 1 Reply Last reply
          2
          • sierdzioS sierdzio

            By default, system keyboard is used on Android. So, when you set focus on TextIntput, your OS keyboard will show (GBoard, SwiftKey, Android Keyboard - whatever you have installed).

            If it does not work for you - well, I don't know. Show us your code, maybe we'll spot something.

            E Offline
            E Offline
            edoardo.videx
            wrote on last edited by
            #5

            @sierdzio
            this is my code:

                TextInput {
                    id: mac_6
                    x: 183
                    y: 8
                    width: 29
                    height: 20
                    text: qsTr("00")
                    transformOrigin: Item.Center
                    font.pixelSize: 12
                    horizontalAlignment: Text.AlignHCenter
                    activeFocusOnPress: true
                    focus: true
                    MouseArea
                    {
                        anchors.fill: parent
                        onClicked:
                        {
                            mac_6.forceActiveFocus();
                            mac_6.openSoftwareInputPanel();
            
                            //Qt.inputMethod.show()
                            console.log("getPrinted")
                        }
                    }
                }
            

            It not work...
            @sierdzio you can help me?

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Remove the mouse area. It is blocking the input. At least that's my suspicion.

              Also, seeing rigid positioning makes me wonder: are you sure you are clicking in the TextIntput? It is very tiny. Recommendation: use layouts. And switch at least to TextEdit which has some more visible GUI.

              (Z(:^

              E 1 Reply Last reply
              1
              • sierdzioS sierdzio

                Remove the mouse area. It is blocking the input. At least that's my suspicion.

                Also, seeing rigid positioning makes me wonder: are you sure you are clicking in the TextIntput? It is very tiny. Recommendation: use layouts. And switch at least to TextEdit which has some more visible GUI.

                E Offline
                E Offline
                edoardo.videx
                wrote on last edited by
                #7

                @sierdzio
                i do this

                    TextInput {
                        id: mac_6
                        x: 183
                        y: 8
                        width: 29
                        height: 20
                        text: qsTr("00")
                        transformOrigin: Item.Center
                        font.pixelSize: 12
                        horizontalAlignment: Text.AlignHCenter
                        activeFocusOnPress: true
                        focus: true
                    }
                

                but not work yet.
                I'm sure that i touch the text input!

                sierdzioS 1 Reply Last reply
                0
                • E edoardo.videx

                  @sierdzio
                  i do this

                      TextInput {
                          id: mac_6
                          x: 183
                          y: 8
                          width: 29
                          height: 20
                          text: qsTr("00")
                          transformOrigin: Item.Center
                          font.pixelSize: 12
                          horizontalAlignment: Text.AlignHCenter
                          activeFocusOnPress: true
                          focus: true
                      }
                  

                  but not work yet.
                  I'm sure that i touch the text input!

                  sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  @edoardo.videx said in Problem with QML Android VirtualKeyBoard:

                  activeFocusOnPress: true
                  focus: true

                  try removing these 2 lines.

                  Also, try making a new, simple, "Hello world" kind of app - if it works there you'd be able to compare what you did wrong here. Perhaps you have some obsolete settings left over from your tries with Qt virtual keyboard and you need to delete them.

                  OS keyboard does show in other applications on that phone, right?

                  (Z(:^

                  E 1 Reply Last reply
                  0
                  • sierdzioS sierdzio

                    @edoardo.videx said in Problem with QML Android VirtualKeyBoard:

                    activeFocusOnPress: true
                    focus: true

                    try removing these 2 lines.

                    Also, try making a new, simple, "Hello world" kind of app - if it works there you'd be able to compare what you did wrong here. Perhaps you have some obsolete settings left over from your tries with Qt virtual keyboard and you need to delete them.

                    OS keyboard does show in other applications on that phone, right?

                    E Offline
                    E Offline
                    edoardo.videx
                    wrote on last edited by
                    #9

                    @sierdzio I resolved the problem. I created a simple application "Hello World" and it work fine. So i analized my old code, and i found the difference casued by impelentation of Virtual KeyBoard. Thanks you so much!

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      Great. Happy coding! :-)

                      (Z(:^

                      1 Reply Last reply
                      0
                      • JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by
                        #11

                        @edoardo-videx said in Problem with QML Android VirtualKeyBoard:

                        activeFocusOnPress: true

                        write a small test program and the keyboard pops up nicely. But it does not show up when TextInput is added into a large project. Weird.

                        1 Reply Last reply
                        0
                        • JoeCFDJ Offline
                          JoeCFDJ Offline
                          JoeCFD
                          wrote on last edited by
                          #12

                          flags: Qt.FramelessWindowHint stops pop-up of android keyboard. Is this a Qt bug?

                          1 Reply Last reply
                          0
                          • JoeCFDJ Offline
                            JoeCFDJ Offline
                            JoeCFD
                            wrote on last edited by
                            #13

                            @JoeCFD said in Problem with QML Android VirtualKeyBoard:

                            Qt.FramelessWindowHint stops pop-up of android keyboard

                            It has to be removed on Android and it is not needed anyway.

                            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