Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Applcation crashes: Qt 5.15.0 Version on using Virtual keyBoard [Debug mode]



  • Hi All

    Following assertion failure is seen

    ASSERT: "!this->inputPanel" in file qvirtualkeyboardinputcontext_p.cpp, line 22

    Scenario :
    Import Qt virtual keyboard

    And use across multiple QML.

    First page , no assertion failure is seen and if we navigate to next page
    in the same session, assertion failure is seen

    We are suspecting , multiple keyboard instance is not supported in Qt 5.15.0.

    Request some one to help in solving above issue

    Thanks and regards
    Satya


  • Moderators

    @Satyakaama
    are you creating a InputPanel element?
    If yes, are you sure it is not destroyed while you switch to the next page?



  • Yes. We are creating InputPanel element.And is not destroyed while switch to next page.

    Regards
    Satya


  • Lifetime Qt Champion

    Hi,

    You should provide a minimal compilable example that triggers this issue.



  • Main.qml

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.VirtualKeyboard 2.2
    import QtQuick.Controls 1.4
    import QtQuick.VirtualKeyboard.Settings 2.2

    Window {
    id: window
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Loader{
        id: virtualkeyboardid
        anchors.centerIn: parent
        height:parent.height
        width:parent.width
        z:10
        source: ""     //"qrc:/KeyboardQML.qml"
        visible: true
    }
    
    TextField {
        anchors.centerIn: parent
        placeholderText: qsTr("Enter name")
    }
    
    Rectangle{
        id:rect
        height: 20
        width: 40
        border.width: 2
        border.color: "blue"
        color: "red"
        anchors.top: parent.top
    
        MouseArea{
            anchors.fill: parent
            onClicked: {
                virtualkeyboardid.source = "qrc:/KeyboardQML.qml" // on click of next page
            }
        }
    }
    
    InputPanel {
        id: inputPanel
        z: 99
        x: 0
        y: window.height
        anchors.bottom: parent.bottom
        anchors.right: parent.right
        width: window.width
    
        states: State {
            name: "visible"
            when: inputPanel.active
            PropertyChanges {
                target: inputPanel
                y: window.height - inputPanel.height
            }
        }
        transitions: Transition {
            from: ""
            to: "visible"
            reversible: true
            ParallelAnimation {
                NumberAnimation {
                    properties: "y"
                    duration: 250
                    easing.type: Easing.InOutQuad
                }
            }
        }
    
        Component.onCompleted: {
            console.log("Component.onCompleted")
        }
    
        Component.onDestruction: {
            console.log("Component.onDestruction:Before")
            inputPanel.
            console.log("Component.onDestruction")
        }
    }
    

    }

    KeyBoard.qml

    import QtQuick 2.0
    import QtQuick.Window 2.15
    import QtQuick.VirtualKeyboard 2.2
    import QtQuick.Controls 1.4

    Item {
    InputPanel {
    id: inputPanel1
    z: 99
    x: 0
    }
    }


  • Lifetime Qt Champion

    Can you test with 5.15.2 ?
    It did not crash for me with that version on macOS.


Log in to reply