See this, for example:
accessing children [github.com]
children arrays as properties [github.com] and this [github.com]
Feel free to roam through the whole project. If you take a look at newer commits (say, after September 2012) you will see how it can be done in C++ (I have moved most of “hardcore” functionality to C++). The project requires Qt5, and works well with QtCreator.
EDIT: thing you really want to take a look at is aimLine, updateAimLine() and aimLineTimer – that stuff looks very much like what you are trying to achieve.
↧