summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-14 14:15:34 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-24 14:39:16 +0000
commitcb142954c54b7a6e391950d9209b5cea9252092b (patch)
tree9fc77260f10bf052af9a00345b99afd61f42a339 /tests/manual
parentb68dfa03489fac8518659d062dce903fb0d15799 (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/diaglib/nativewindowdump.cpp17
1 files changed, 16 insertions, 1 deletions
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 <QtGui/QGuiApplication>
+# include <qpa/qplatformnativeinterface.h>
+#endif
+
+#include <QtCore/QDebug>
+
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()