QML Keys.onSpacepressed



  • i have a SequentialAnimation in QML
    @SequentialAnimation{
    id: ballAnimation
    NumberAnimation{ target: player; property: "y"; from: player.y; to: player.y - 170 }

        PauseAnimation { duration: 150 }
    
        NumberAnimation{ target: player; property: "y"; from: player.y - 170; to: player.y }
    
        running: false
    }
    

    Keys.onSpacepressed : ballAnimation.running = true
    @

    bt nthing happens wen i press the Spacebar....can anybody help me out ??



  • Hi,

    check if QML Item that contains this code has focus.

    See http://doc.qt.nokia.com/4.7-snapshot/qml-keyevent.html for more information.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.