Does VirtualKeyboard offer any way to have a dark transparent overlay surrounding the TextField that activates the inputPanel?



  • I'm very new to QML. I have a TextField which activates VirtualKeyboard when it has the focus. I would like to have a dark transparent overlay surrounding this TextField which only appears when the VirtualKeyboard is activated by the TextField. Is there any built-in method in VirtualKeyboard do accomplish this?

    Thanks


  • Moderators

    @red.green
    hi, I'm unfamiliar with the virtual keyboard.

    But I have the following idea.

    inside your TextField, you listend to onActiveFocusChanged if that becomes true, that the virtual keyboard should be called forth.

    On you can than listen to the editingFinished signal and force the focus on the parent. to guarantee that the active focus is really gone after editing

    Item{//arbitary parent
    TextField{
         onActiveFocusChanged: if(activeFocus) //do stuff
         onEditingFinished: parent.forceActiveFocus()
    }
    }