summaryrefslogtreecommitdiffstats
path: root/tests/manual/diaglib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/diaglib')
-rw-r--r--tests/manual/diaglib/eventfilter.cpp9
-rw-r--r--tests/manual/diaglib/nativewindowdump_win.cpp48
-rw-r--r--tests/manual/diaglib/qwindowdump.cpp13
-rw-r--r--tests/manual/diaglib/textdump.cpp12
4 files changed, 72 insertions, 10 deletions
diff --git a/tests/manual/diaglib/eventfilter.cpp b/tests/manual/diaglib/eventfilter.cpp
index b35d29cc8a..6df885ebb6 100644
--- a/tests/manual/diaglib/eventfilter.cpp
+++ b/tests/manual/diaglib/eventfilter.cpp
@@ -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
}
diff --git a/tests/manual/diaglib/nativewindowdump_win.cpp b/tests/manual/diaglib/nativewindowdump_win.cpp
index e3885eb96d..b25f8aa864 100644
--- a/tests/manual/diaglib/nativewindowdump_win.cpp
+++ b/tests/manual/diaglib/nativewindowdump_win.cpp
@@ -48,9 +48,10 @@
namespace QtDiag {
struct DumpContext {
- DumpContext() : indentation(0) {}
+ DumpContext() : indentation(0), parent(0) {}
int indentation;
+ HWND parent;
QSharedPointer<QTextStream> stream;
};
@@ -64,11 +65,19 @@ static void formatNativeWindow(HWND hwnd, QTextStream &str)
RECT rect;
if (GetWindowRect(hwnd, &rect)) {
str << ' ' << (rect.right - rect.left) << 'x' << (rect.bottom - rect.top)
- << '+' << rect.left << '+' << rect.top;
+ << forcesign << rect.left << rect.top << noforcesign;
}
if (IsWindowVisible(hwnd))
str << " [visible]";
+ wchar_t buf[512];
+ if (GetWindowText(hwnd, buf, sizeof(buf)/sizeof(buf[0])) && buf[0])
+ str << " title=\"" << QString::fromWCharArray(buf) << "\"/";
+ else
+ str << ' ';
+ if (GetClassName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
+ str << '"' << QString::fromWCharArray(buf) << '"';
+
str << hex << showbase;
if (const LONG_PTR style = GetWindowLongPtr(hwnd, GWL_STYLE)) {
str << " style=" << style;
@@ -121,13 +130,31 @@ static void formatNativeWindow(HWND hwnd, QTextStream &str)
debugWinStyle(str, exStyle, WS_EX_COMPOSITED)
debugWinStyle(str, exStyle, WS_EX_NOACTIVATE)
}
+
+ if (const ULONG_PTR classStyle = GetClassLongPtr(hwnd, GCL_STYLE)) {
+ str << " classStyle=" << classStyle;
+ debugWinStyle(str, classStyle, CS_BYTEALIGNCLIENT)
+ debugWinStyle(str, classStyle, CS_BYTEALIGNWINDOW)
+ debugWinStyle(str, classStyle, CS_CLASSDC)
+ debugWinStyle(str, classStyle, CS_DBLCLKS)
+ debugWinStyle(str, classStyle, CS_DROPSHADOW)
+ debugWinStyle(str, classStyle, CS_GLOBALCLASS)
+ debugWinStyle(str, classStyle, CS_HREDRAW)
+ debugWinStyle(str, classStyle, CS_NOCLOSE)
+ debugWinStyle(str, classStyle, CS_OWNDC)
+ debugWinStyle(str, classStyle, CS_PARENTDC)
+ debugWinStyle(str, classStyle, CS_SAVEBITS)
+ debugWinStyle(str, classStyle, CS_VREDRAW)
+ }
+
+ if (const ULONG_PTR wndProc = GetClassLongPtr(hwnd, GCLP_WNDPROC))
+ str << " wndProc=" << wndProc;
+
str << noshowbase << dec;
- wchar_t buf[512];
- if (GetWindowText(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
- str << " title=\"" << QString::fromWCharArray(buf) << '"';
- if (GetClassName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
- str << " class=\"" << QString::fromWCharArray(buf) << '"';
+ if (GetWindowModuleFileName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
+ str << " module=\"" << QString::fromWCharArray(buf) << '"';
+
str << '\n';
}
@@ -135,7 +162,11 @@ static void dumpNativeWindowRecursion(HWND hwnd, DumpContext *dc);
BOOL CALLBACK dumpWindowEnumChildProc(HWND hwnd, LPARAM lParam)
{
- dumpNativeWindowRecursion(hwnd, reinterpret_cast<DumpContext *>(lParam));
+ DumpContext *dumpContext = reinterpret_cast<DumpContext *>(lParam);
+ // EnumChildWindows enumerates grand children as well, skip these to
+ // get the hierarchical formatting right.
+ if (GetAncestor(hwnd, GA_PARENT) == dumpContext->parent)
+ dumpNativeWindowRecursion(hwnd, dumpContext);
return TRUE;
}
@@ -145,6 +176,7 @@ static void dumpNativeWindowRecursion(HWND hwnd, DumpContext *dc)
formatNativeWindow(hwnd, *dc->stream);
DumpContext nextLevel = *dc;
nextLevel.indentation += 2;
+ nextLevel.parent = hwnd;
EnumChildWindows(hwnd, dumpWindowEnumChildProc, reinterpret_cast<LPARAM>(&nextLevel));
}
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp
index a77bae22e9..c0faefb918 100644
--- a/tests/manual/diaglib/qwindowdump.cpp
+++ b/tests/manual/diaglib/qwindowdump.cpp
@@ -38,6 +38,9 @@
# include <QtGui/QScreen>
# include <QtGui/QWindow>
# include <qpa/qplatformwindow.h>
+# if QT_VERSION >= 0x050600
+# include <private/qhighdpiscaling_p.h>
+# endif
#endif
#include <QtCore/QMetaObject>
#include <QtCore/QRect>
@@ -131,9 +134,19 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option
str << "[top] ";
if (w->isExposed())
str << "[exposed] ";
+ if (w->surfaceClass() == QWindow::Offscreen)
+ str << "[offscreen] ";
+ str << "surface=" << w->surfaceType() << ' ';
if (const Qt::WindowState state = w->windowState())
str << "windowState=" << state << ' ';
formatRect(str, w->geometry());
+ if (w->isTopLevel()) {
+ str << " \"" << w->screen()->name() << "\" ";
+#if QT_VERSION >= 0x050600
+ if (QHighDpiScaling::isActive())
+ str << "factor=" << QHighDpiScaling::factor(w) << ' ';
+#endif
+ }
if (!(options & DontPrintWindowFlags)) {
str << ' ';
formatWindowFlags(str, w->flags());
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp
index ed4d5021be..0f69166a43 100644
--- a/tests/manual/diaglib/textdump.cpp
+++ b/tests/manual/diaglib/textdump.cpp
@@ -248,6 +248,15 @@ static const EnumLookup scriptEnumLookup[] =
{QChar::Script_Tirhuta, "Script_Tirhuta"},
{QChar::Script_WarangCiti, "Script_WarangCiti"},
#endif // Qt 5.5
+
+#if QT_VERSION >= 0x050600
+ {QChar::Script_Ahom, "Script_Ahom"},
+ {QChar::Script_AnatolianHieroglyphs, "Script_AnatolianHieroglyphs"},
+ {QChar::Script_Hatran, "Script_Hatran"},
+ {QChar::Script_Multani, "Script_Multani"},
+ {QChar::Script_OldHungarian, "Script_OldHungarian"},
+ {QChar::Script_SignWriting, "Script_SignWriting"},
+#endif // Qt 5.5
};
#endif // Qt 5.1
@@ -364,6 +373,9 @@ static const EnumLookup unicodeVersionEnumLookup[] =
#if QT_VERSION >= 0x050500
{QChar::Unicode_7_0, "Unicode_7_0"},
#endif // Qt 5.5
+#if QT_VERSION >= 0x050600
+ {QChar::Unicode_8_0, "Unicode_8_0"},
+#endif // Qt 5.6
#endif // Qt 5
};