summaryrefslogtreecommitdiffstats
path: root/tests/manual/diaglib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/diaglib')
-rw-r--r--tests/manual/diaglib/debugproxystyle.cpp4
-rw-r--r--tests/manual/diaglib/diaglib.pri27
-rw-r--r--tests/manual/diaglib/qwidgetdump.cpp6
-rw-r--r--tests/manual/diaglib/qwindowdump.cpp9
-rw-r--r--tests/manual/diaglib/textdump.cpp6
5 files changed, 23 insertions, 29 deletions
diff --git a/tests/manual/diaglib/debugproxystyle.cpp b/tests/manual/diaglib/debugproxystyle.cpp
index ed35af5962..809613cd1d 100644
--- a/tests/manual/diaglib/debugproxystyle.cpp
+++ b/tests/manual/diaglib/debugproxystyle.cpp
@@ -68,8 +68,8 @@ QDebug operator<<(QDebug debug, const QStyleOption *option)
} else {
debug << "QStyleOption(";
}
- debug << "rect=" << option->rect.width() << 'x' << option->rect.height()
- << forcesign << option->rect.x() << option->rect.y() << noforcesign;
+ debug << "rect=" << option->rect.width() << 'x' << option->rect.height() << Qt::forcesign
+ << option->rect.x() << option->rect.y() << Qt::noforcesign;
if (option->state != QStyle::State_None)
debug << ", state=" << option->state;
#if QT_VERSION >= 0x050000
diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri
index b57ee75841..ace9caecc6 100644
--- a/tests/manual/diaglib/diaglib.pri
+++ b/tests/manual/diaglib/diaglib.pri
@@ -17,20 +17,8 @@ win32:!winrt: {
SOURCES += $$PWD/nativewindowdump.cpp
}
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += gui-private core-private
- contains(QT, widgets) {
- HEADERS += \
- $$PWD/qwidgetdump.h \
- $$PWD/debugproxystyle.h \
- $$PWD/logwidget.h
-
- SOURCES += \
- $$PWD/qwidgetdump.cpp \
- $$PWD/debugproxystyle.cpp \
- $$PWD/logwidget.cpp
- }
-} else {
+QT += gui-private core-private
+contains(QT, widgets) {
HEADERS += \
$$PWD/qwidgetdump.h \
$$PWD/debugproxystyle.h \
@@ -40,14 +28,17 @@ greaterThan(QT_MAJOR_VERSION, 4) {
$$PWD/qwidgetdump.cpp \
$$PWD/debugproxystyle.cpp \
$$PWD/logwidget.cpp
+ QT += widgets-private
}
contains(QT, opengl) {
-HEADERS += \
- $$PWD/glinfo.h
+ HEADERS += \
+ $$PWD/glinfo.h
-SOURCES += \
- $$PWD/glinfo.cpp
+ SOURCES += \
+ $$PWD/glinfo.cpp
+
+ QT += opengl
}
DEFINES += QT_DIAG_LIB
diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp
index 5a2966021b..926d2aaf35 100644
--- a/tests/manual/diaglib/qwidgetdump.cpp
+++ b/tests/manual/diaglib/qwidgetdump.cpp
@@ -86,14 +86,16 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w,
formatWidgetClass(str, w);
str << ' ' << (w->isVisible() ? "[visible] " : "[hidden] ");
if (const WId nativeWinId = w->internalWinId())
- str << "[native: " << hex << showbase << nativeWinId << dec << noshowbase << "] ";
+ str << "[native: " << Qt::hex << Qt::showbase << nativeWinId << Qt::dec << Qt::noshowbase
+ << "] ";
if (w->isWindow())
str << "[top] ";
str << (w->testAttribute(Qt::WA_Mapped) ? "[mapped] " : "[not mapped] ");
if (w->testAttribute(Qt::WA_DontCreateNativeAncestors))
str << "[NoNativeAncestors] ";
if (const int states = w->windowState())
- str << "windowState=" << hex << showbase << states << dec << noshowbase << ' ';
+ str << "windowState=" << Qt::hex << Qt::showbase << states << Qt::dec << Qt::noshowbase
+ << ' ';
formatRect(str, w->geometry());
if (w->isWindow()) {
str << ' ' << w->logicalDpiX() << "DPI";
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp
index 381b683359..2be26ff142 100644
--- a/tests/manual/diaglib/qwindowdump.cpp
+++ b/tests/manual/diaglib/qwindowdump.cpp
@@ -61,8 +61,8 @@ 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;
+ str << geom.width() << 'x' << geom.height() << 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,8 @@ 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())
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp
index 383ec4edb0..33455a2a56 100644
--- a/tests/manual/diaglib/textdump.cpp
+++ b/tests/manual/diaglib/textdump.cpp
@@ -408,8 +408,8 @@ struct FormattingContext
static void formatCharacter(QTextStream &str, const QChar &qc, FormattingContext &context)
{
const ushort unicode = qc.unicode();
- str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << uppercasedigits << hex << unicode
- << dec << qSetFieldWidth(0) << ' ';
+ str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << Qt::uppercasedigits << Qt::hex
+ << unicode << Qt::dec << qSetFieldWidth(0) << ' ';
const EnumLookup *specialChar = enumLookup(unicode, specialCharactersEnumLookup, sizeof(specialCharactersEnumLookup) / sizeof(EnumLookup));
if (specialChar)
@@ -477,7 +477,7 @@ QString dumpTextAsCode(const QString &text)
{
QString result;
QTextStream str(&result);
- str << " QString result;\n" << hex << showbase;
+ str << " QString result;\n" << Qt::hex << Qt::showbase;
for (QChar c : text)
str << " result += QChar(" << c.unicode() << ");\n";
str << '\n';