A program i'm writing has to for a given widget, cycle through its children in an automated manner. That is to say, we can not assume to have any knowledge about any child widgets but would like to loop through them at run time.

The QWidget class has the bool focusNextChild() and bool focusPreviousChild() methods. These however, shift the focus to the next child widget. I want to simply identify and return a pointer to the next or previous child widget. Example method names might be: QWidget* findNextChild() and QWidget* findPreviousChild()

Any suggestions? I hope i'm explaining the problem well enough..