diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-28 11:46:16 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-25 14:30:24 +0100 |
commit | cc333f5faf2fa892ca0e321915263cab5d793191 (patch) | |
tree | bf996aebbf68a6e5df335acc0da41ba3a216d1fb /tests/manual/diaglib/qwindowdump.cpp | |
parent | 46ebd11e66f6f3180043a7258b46a1aff79a69f8 (diff) |
Diaglib: Fix build
Use range-based for and fix deprecation warnings.
Change-Id: I54152b2598e9e4a7a3cc9db9b7072bbabcef7fcf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/manual/diaglib/qwindowdump.cpp')
-rw-r--r-- | tests/manual/diaglib/qwindowdump.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp index 381b683359..83e29fc183 100644 --- a/tests/manual/diaglib/qwindowdump.cpp +++ b/tests/manual/diaglib/qwindowdump.cpp @@ -62,7 +62,7 @@ void formatObject(QTextStream &str, const QObject *o) void formatRect(QTextStream &str, const QRect &geom) { str << geom.width() << 'x' << geom.height() - << forcesign << geom.x() << geom.y() << noforcesign; + << Qt::forcesign << geom.x() << geom.y() << Qt::noforcesign; } #define debugType(s, type, typeConstant) \ @@ -75,7 +75,7 @@ if (flags & flagConstant) \ void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) { - str << showbase << hex << unsigned(flags) << dec << noshowbase; + str << Qt::showbase << Qt::hex << unsigned(flags) << Qt::dec << Qt::noshowbase; const Qt::WindowFlags windowType = flags & Qt::WindowType_Mask; debugFlag(str, flags, Qt::Window) debugType(str, windowType, Qt::Dialog) @@ -123,7 +123,7 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option formatObject(str, w); str << ' ' << (w->isVisible() ? "[visible] " : "[hidden] "); if (const WId nativeWinId = pw ? pw->winId() : WId(0)) - str << "[native: " << hex << showbase << nativeWinId << dec << noshowbase << "] "; + str << "[native: " << Qt::hex << Qt::showbase << nativeWinId << Qt::dec << Qt::noshowbase << "] "; if (w->isTopLevel()) str << "[top] "; if (w->isExposed()) @@ -162,7 +162,7 @@ static void dumpWindowRecursion(QTextStream &str, const QWindow *w, { indentStream(str, 2 * depth); formatWindow(str, w, options); - foreach (const QObject *co, w->children()) { + for (const QObject *co : w->children()) { if (co->isWindowType()) dumpWindowRecursion(str, static_cast<const QWindow *>(co), options, depth + 1); } @@ -173,7 +173,7 @@ void dumpAllWindows(FormatWindowOptions options) QString d; QTextStream str(&d); str << "### QWindows:\n"; - foreach (QWindow *w, QGuiApplication::topLevelWindows()) + for (QWindow *w : QGuiApplication::topLevelWindows()) dumpWindowRecursion(str, w, options); #if QT_VERSION >= 0x050400 qDebug().noquote() << d; |