A working example of using state machines in QML