In the examples\mainwindows\mdi

i tried the following code

Qt Code:
  1. QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
  2. foreach (QMdiSubWindow *pSubWindow, windows)
  3. {
  4. bActive = pSubWindow->isActiveWindow();
  5. bHasFocus = pSubWindow->hasFocus();
  6. }
To copy to clipboard, switch view to plain text mode 

I tried with 3 subwindows. Even though only one is active [ie selected], all the subwindows are giving the status as active....Also none of the subwindows are having the focus...Why..?