It is strongly recommended to read the Qt docs, as they are really good, and will supply answers most of the time, including this question.
To your question:
First of all you will need to make your 'child' variable a member, so that you can hold the pointer to the window you want to check.
Then you have QMdiArea::activeSubWindow() so you can see if your 'child' is the active one.
Or, if you need some other criteria that is not satisfied by activeSubWindow(), you can iterate though all the sub windows by getting them from QMdiArea::subWindowList().