Fix compile errors related to missing Qt:: namespace

Change-Id: I092a26ef38b08c52d84adb027a1b1bdee8cc7f6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Leander Beernaert 2019-11-11 14:03:37 +01:00
parent 937e014e63
commit ce187c4f0e
12 changed files with 68 additions and 54 deletions

View File

@ -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

View File

@ -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";

View File

@ -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())

View File

@ -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';

View File

@ -190,7 +190,8 @@ QTextStream &operator<<(QTextStream &s, const QSizeF &size)
QTextStream &operator<<(QTextStream &s, const QRectF &rect)
{
s << rect.width() << 'x' << rect.height() << forcesign << rect.x() << rect.y() << noforcesign;
s << rect.width() << 'x' << rect.height() << Qt::forcesign << rect.x() << rect.y()
<< Qt::noforcesign;
return s;
}

View File

@ -63,7 +63,7 @@
static QTextStream &operator<<(QTextStream &str, const QRect &r)
{
str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign;
str << r.width() << 'x' << r.height() << Qt::forcesign << r.x() << r.y() << Qt::noforcesign;
return str;
}

View File

@ -58,7 +58,7 @@ void tst_qhttpnetworkconnection::bigRemoteFile()
QVERIFY(!QTestEventLoop::instance().timeout());
size = reply->size();
delete reply;
qDebug() << "Finished!" << endl;
qDebug() << "Finished!" << Qt::endl;
qDebug() << "Time:" << t.elapsed() << "msec";
qDebug() << "Bytes:" << size;
qDebug() << "Speed:" << (size / qreal(1024)) / (t.elapsed() / qreal(1000)) << "KB/sec";

View File

@ -39,33 +39,41 @@
void printShortUsage()
{
qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl
<< "Get one or more urls using QNetworkAccessManager" << endl
<< "--help to display detailed usage" << endl;
qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << Qt::endl
<< "Get one or more urls using QNetworkAccessManager" << Qt::endl
<< "--help to display detailed usage" << Qt::endl;
}
void printUsage()
{
qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl
<< "Get one or more urls using QNetworkAccessManager" << endl
qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << Qt::endl
<< "Get one or more urls using QNetworkAccessManager" << Qt::endl
<< "Options:"
<< "--help This message" << endl
<< "--user=<username> Set username to use for authentication" << endl
<< "--password=<password> Set password to use for authentication" << endl
<< "--proxy-user=<username> Set username to use for proxy authentication" << endl
<< "--proxy-password=<password> Set password to use for proxy authentication" << endl
<< "--proxy=on Use system proxy (default)" << endl
<< "--proxy=off Don't use system proxy" << endl
<< "--proxy=<host:port>[,type] Use specified proxy" << endl
<< " ,http HTTP proxy (default)" << endl
<< " ,socks SOCKS5 proxy" << endl
<< " ,ftp FTP proxy" << endl
<< " ,httpcaching HTTP caching proxy (no CONNECT method)" << endl
<< "--headers=filename Set request headers from file contents" << endl
<< "--post=filename upload the file to the next url using HTTP POST" << endl
<< "--put=filename upload the file to the next url using HTTP PUT" << endl
<< "--content-type=<MIME> set content-type header for upload" << endl
<< "--serial don't run requests in parallel" << endl;
<< "--help This message" << Qt::endl
<< "--user=<username> Set username to use for authentication"
<< Qt::endl
<< "--password=<password> Set password to use for authentication"
<< Qt::endl
<< "--proxy-user=<username> Set username to use for proxy authentication"
<< Qt::endl
<< "--proxy-password=<password> Set password to use for proxy authentication"
<< Qt::endl
<< "--proxy=on Use system proxy (default)" << Qt::endl
<< "--proxy=off Don't use system proxy" << Qt::endl
<< "--proxy=<host:port>[,type] Use specified proxy" << Qt::endl
<< " ,http HTTP proxy (default)" << Qt::endl
<< " ,socks SOCKS5 proxy" << Qt::endl
<< " ,ftp FTP proxy" << Qt::endl
<< " ,httpcaching HTTP caching proxy (no CONNECT method)"
<< Qt::endl
<< "--headers=filename Set request headers from file contents"
<< Qt::endl
<< "--post=filename upload the file to the next url using HTTP POST"
<< Qt::endl
<< "--put=filename upload the file to the next url using HTTP PUT"
<< Qt::endl
<< "--content-type=<MIME> set content-type header for upload" << Qt::endl
<< "--serial don't run requests in parallel" << Qt::endl;
}
int main(int argc, char *argv[])

View File

@ -192,15 +192,15 @@ static inline QString msgScreenChange(const QWidget *w, const QScreen *oldScreen
if (!newScreen) {
result = QLatin1String("Screen changed --> null");
} else if (!oldScreen) {
QTextStream(&result) << "Screen changed null --> \""
<< newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: "
<< geometry.width() << 'x' << geometry.height() << forcesign << geometry.x()
<< geometry.y() << '.';
QTextStream(&result) << "Screen changed null --> \"" << newScreen->name() << "\" at "
<< pos.x() << ',' << pos.y() << " geometry: " << geometry.width()
<< 'x' << geometry.height() << Qt::forcesign << geometry.x()
<< geometry.y() << '.';
} else {
QTextStream(&result) << "Screen changed \"" << oldScreen->name() << "\" --> \""
<< newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: "
<< geometry.width() << 'x' << geometry.height() << forcesign << geometry.x()
<< geometry.y() << '.';
<< newScreen->name() << "\" at " << pos.x() << ',' << pos.y()
<< " geometry: " << geometry.width() << 'x' << geometry.height()
<< Qt::forcesign << geometry.x() << geometry.y() << '.';
}
return result;
}

View File

@ -37,13 +37,13 @@ int main(int argc, char **argv)
if (argc < 3) {
QTextStream out(stdout);
out << "Usage: " << argv[0] << " host port [options]" << endl;
out << "The options can be one or more of the following:" << endl;
out << "enable_empty_fragments" << endl;
out << "disable_session_tickets" << endl;
out << "disable_compression" << endl;
out << "disable_sni" << endl;
out << "enable_unsafe_reneg" << endl;
out << "Usage: " << argv[0] << " host port [options]" << Qt::endl;
out << "The options can be one or more of the following:" << Qt::endl;
out << "enable_empty_fragments" << Qt::endl;
out << "disable_session_tickets" << Qt::endl;
out << "disable_compression" << Qt::endl;
out << "disable_sni" << Qt::endl;
out << "enable_unsafe_reneg" << Qt::endl;
return 1;
}

View File

@ -526,7 +526,7 @@ void MainWindow::updateScreenLabel()
const QRect geometry = screen->geometry();
const qreal dpr = screen->devicePixelRatio();
str << '"' << screen->name() << "\" " << geometry.width() << 'x' << geometry.height()
<< forcesign << geometry.x() << geometry.y() << noforcesign;
<< Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign;
if (!qFuzzyCompare(dpr, qreal(1)))
str << ", dpr=" << dpr;
m_screenLabel->setText(text);

View File

@ -48,7 +48,8 @@ void PreviewWindow::paintEvent(QPaintEvent *event)
static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags)
{
str << "Window flags: " << hex << showbase << unsigned(flags) << noshowbase << dec << ' ';
str << "Window flags: " << Qt::hex << Qt::showbase << unsigned(flags) << Qt::noshowbase
<< Qt::dec << ' ';
switch (flags & Qt::WindowType_Mask) {
case Qt::Window:
str << "Qt::Window";
@ -125,7 +126,8 @@ static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags)
static void formatWindowStates(QTextStream &str, Qt::WindowStates states)
{
str << "Window states: " << hex << showbase << unsigned(states) << noshowbase << dec << ' ';
str << "Window states: " << Qt::hex << Qt::showbase << unsigned(states) << Qt::noshowbase
<< Qt::dec << ' ';
if (states & Qt::WindowActive) {
str << "Qt::WindowActive ";
states &= ~Qt::WindowActive;
@ -150,7 +152,7 @@ static void formatWindowStates(QTextStream &str, Qt::WindowStates states)
QTextStream &operator<<(QTextStream &str, const QRect &r)
{
str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign;
str << r.width() << 'x' << r.height() << Qt::forcesign << r.x() << r.y() << Qt::noforcesign;
return str;
}