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

Remove property animation



  • We have decided our current virtualKeyboard does not match up well enough to our number pad and so we want to alter it and or get rid of it all together and replace it. Currently, the only thing stopping me from being able to reuse the current code is this keyboard's property animation. At least, I believe it is the property animation (new to QML and Qt).. basically once you click on the input text box it sort of slides up from the bottom of the screen. I believe that is the property animation that this code is referring too:

    ...
    property alias focusControl: focusControlArea.enabled
        property AbstractInputField target: null
        readonly property bool shown: target !== null
        readonly property real targetYOffset: {
            if (target === null)
                return 0
    
            var globalTargetPos = target.mapToItem(null, 0, target.height)
            var keyboardPanelY = keyboardPanel.height - visiblePanel.height
    
            if(globalTargetPos.y > keyboardPanelY)
                return keyboardPanelY - globalTargetPos.y
            else
                return 0
        }
    
        y: shown ? 0 : height
        z: 1000
        width: parent.width
        height: parent.height
    
        Behavior on y { PropertyAnimation {} }
    
        MouseArea {
            id: focusControlArea
            width: parent.width
            anchors.top: parent.top
            anchors.bottom: visiblePanel.top
            onClicked: target.cancel()
        }
    
        Rectangle {
            id: visiblePanel
            y: parent.height - height
            width: parent.width
            height: styleKeyboardPanel.keyHeight * 4 + styleKeyboardPanel.keySpacing * 3 + styleKeyboardPanel.padding * 2
            color: styleKeyboardPanel.colorBackground
    
            MouseArea {
                anchors.fill: parent
            }
    ...
    

    If I can simply alter this current keyboard s/t it doesn't slide up from the bottom of the screen but instead opens up a window of its own than with enough alteration to the style and format of it I wont have to re-write an entirely new keyboard. Perhaps someone could give me a clue as to how I can go about getting rid of this property animation?



  • @Circuits said in Remove property animation:

    Behavior on y { PropertyAnimation {} }

    Commenting this should remove the animation, basically it says that when ychanges, it is animated from old position to new one, with a duration of 250ms by default.



  • @Gojir4 Oh my, I was way over complicating this, thank you.


Log in to reply