Is it possible to make the InputPanel a WebEngineView element?

49 Views Asked by At

Is it possible to substitute the InputPanel (qt virtual keyboard) element with a WebEngineView?

So that it still opens when input is requested but is a webview element.

Changing the InputPanel to WebEngineView results in the virtual keyboard showing up above the app/standalone and no longer inside the respective window.

I am using the Lifecycle example as a base with QT 6.5 (MSVC 2019 64-bit). https://code.qt.io/cgit/qt/qtwebengine.git/tree/examples/webenginequick/lifecycle?h=6.5

With the virtual keyboard module import QtQuick.VirtualKeyboard added.


WebTabStack {
        id: tabStack

        z: 0
        anchors.fill: parent

        currentIndex: tabBar.currentIndex
        freezeDelay: freezeSpin.enabled && freezeSpin.value
        discardDelay: discardSpin.enabled && discardSpin.value

        onCloseRequested: function(index) {
            root.closeTab(index)
        }

        onDrawerRequested: drawer.toggle()
    }


// v WebEngineView instead of panel but same properties

    InputPanel {
                id: inputPanel
                z: 99
                y: root.height
                visible: false
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.leftMargin: 350
                anchors.rightMargin: 350
                states: State {
                    name: "visible"
                    when: Qt.inputMethod.visible
                    PropertyChanges {
                        target: inputPanel
                        y: root.height - inputPanel.height
                        visible: true

                    }
                }
                transitions: Transition {
                    from: ""
                    to: "visible"
                    reversible: true
                    ParallelAnimation {
                        NumberAnimation {
                            properties: "y"
                            duration: 150
                            easing.type: Easing.InOutQuad
                        }
                    }
                }
        }
0

There are 0 best solutions below