From cb142954c54b7a6e391950d9209b5cea9252092b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 14 Dec 2017 14:15:34 +0100 Subject: XCB: Implement native window dump for diaglib Extract a helper function to determine the window title from QXcbConnection and add an invokable function to the native interface that dumps the window tree similar to existing functionality on Windows. Change-Id: I5544d69ea2b801eb16d3b5b8d64021b3e567b0d8 Reviewed-by: Shawn Rutledge --- tests/manual/diaglib/nativewindowdump.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests/manual') diff --git a/tests/manual/diaglib/nativewindowdump.cpp b/tests/manual/diaglib/nativewindowdump.cpp index 83edf878b3..a854e8a790 100644 --- a/tests/manual/diaglib/nativewindowdump.cpp +++ b/tests/manual/diaglib/nativewindowdump.cpp @@ -28,10 +28,25 @@ #include "nativewindowdump.h" +#if QT_VERSION >= 0x050000 +# include +# include +#endif + +#include + namespace QtDiag { -void dumpNativeWindows(WId) +void dumpNativeWindows(WId wid) { +#if QT_VERSION >= 0x050000 + QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface(); + QString result; + QMetaObject::invokeMethod(ni, "dumpNativeWindows", Qt::DirectConnection, + Q_RETURN_ARG(QString, result), + Q_ARG(WId, wid)); + qDebug().noquote() << result; +#endif // Qt 5 } void dumpNativeQtTopLevels() -- cgit v1.2.3