Diaglib: Output QGuiApplication::focusObject() in focus changes, too.

This is useful for diagnosing QML focus issues.

Task-number: QTBUG-48199
Change-Id: Iff2cc35850e7020a9198b38256d1331587d0eefb
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2015-09-15 10:57:54 +02:00
parent f8cc0164db
commit 45bf434cdc

View File

@ -190,8 +190,13 @@ static void formatApplicationState(QDebug debug)
debug << "\n QGuiApplication::modalWindow = ";
formatObject(mw, debug);
}
debug << "\n QGuiApplication::focusWindow = ";
formatObject(QGuiApplication::focusWindow(), debug);
const QObject *focusObject = QGuiApplication::focusObject();
const QObject *focusWindow = QGuiApplication::focusWindow();
debug << "\n QGuiApplication::focusObject = ";
formatObject(focusObject, debug);
if (focusWindow && focusWindow != focusObject)
debug << "\n QGuiApplication::focusWindow = ";
formatObject(focusWindow, debug);
#endif // HAVE_GUI_APPLICATION
}