If a widget created with QWidget::createWindowContainer has focus, then QApplication::activeWindow() returns NULL.
SAMPLE PROJECT INCLUDED. PLEASE READ INSTRUCTIONS.
1. Run sample project. You will need to view the 'Output' to see results.
2. Press button at top of window. Now click on a list item near bottom. Click on button again. Output is 'NULL' for activeWindow.
3. Now switch to another application and back to the sample application. Click on the button immediately without clicking on the list. Output is non-NULL for activeWindow.
4. Click on list again. Notice output is again 'NULL'.
QApplication::activeWindow is returned as NULL when focus is on the list (Qml embedded with QWidget::createWindowContainer).