The new configs from QImage allows us to declare the source images position and size. The input values are stored to an array and only changed on keydown and keyup. The animation frame moves the sprite according to the row and input keys. The walk cycle for the sprite I used had the default stance in the middle column. The code is pretty thoroughly commented, enjoy! wasd and arrow keys to move!
Link to QImage Sprite Demo
Link to Original Post