diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-04-30 12:51:36 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-05-02 11:52:02 +0000 |
commit | 343528841e72adf36a37d9afd7260e260a9342eb (patch) | |
tree | 399c295e0e08975106c12c7ef7deecd73436cf66 /src/gui | |
parent | 185ba7f4cfd577189f9d8b9d55d7f9ae467055d3 (diff) |
Prefix textstream operators with Qt::
As the non prefixed variants are deprecated
Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 4 | ||||
-rw-r--r-- | src/gui/doc/snippets/textdocumentendsnippet.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qicon.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qpalette.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/math3d/qgenericmatrix.h | 4 | ||||
-rw-r--r-- | src/gui/math3d/qmatrix4x4.cpp | 10 | ||||
-rw-r--r-- | src/gui/opengl/qopengl.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qblendfunctions_p.h | 16 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qpaintengineex.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qfontengine.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfontengine_qpf2.cpp | 6 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 8 |
19 files changed, 49 insertions, 49 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 46dec7f28d..de76d12a5e 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -1858,7 +1858,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface) return d; } d.nospace(); - d << "QAccessibleInterface(" << hex << (const void *) iface << dec; + d << "QAccessibleInterface(" << Qt::hex << (const void *) iface << Qt::dec; if (iface->isValid()) { d << " name=" << iface->text(QAccessible::Name) << ' '; d << "role=" << qAccessibleRoleString(iface->role()) << ' '; @@ -1897,7 +1897,7 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev) QDebugStateSaver saver(d); d.nospace() << "QAccessibleEvent("; if (ev.object()) { - d.nospace() << "object=" << hex << ev.object() << dec; + d.nospace() << "object=" << Qt::hex << ev.object() << Qt::dec; d.nospace() << "child=" << ev.child(); } else { d.nospace() << "no object, uniqueId=" << ev.uniqueId(); diff --git a/src/gui/doc/snippets/textdocumentendsnippet.cpp b/src/gui/doc/snippets/textdocumentendsnippet.cpp index c8de501838..cb7abd5ca7 100644 --- a/src/gui/doc/snippets/textdocumentendsnippet.cpp +++ b/src/gui/doc/snippets/textdocumentendsnippet.cpp @@ -59,7 +59,7 @@ int main(int argv, char **args) //! [0] for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next()) - cout << it.text().toStdString() << endl; + cout << it.text().toStdString() << Qt::endl; //! [0] return 0; diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 892a686c89..2b47fb536b 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1496,7 +1496,7 @@ QDebug operator<<(QDebug dbg, const QIcon &i) if (!i.name().isEmpty()) dbg << i.name() << ','; dbg << "availableSizes[normal,Off]=" << i.availableSizes() - << ",cacheKey=" << showbase << hex << i.cacheKey() << dec << noshowbase; + << ",cacheKey=" << Qt::showbase << Qt::hex << i.cacheKey() << Qt::dec << Qt::noshowbase; } dbg << ')'; return dbg; diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 5b4d218603..399ad7453d 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1689,7 +1689,7 @@ QDebug operator<<(QDebug dbg, const QPixmap &r) } else { dbg << r.size() << ",depth=" << r.depth() << ",devicePixelRatio=" << r.devicePixelRatio() - << ",cacheKey=" << showbase << hex << r.cacheKey() << dec << noshowbase; + << ",cacheKey=" << Qt::showbase << Qt::hex << r.cacheKey() << Qt::dec << Qt::noshowbase; } dbg << ')'; return dbg; diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 7349a400a6..deff56aa58 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -1129,8 +1129,8 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const // write header QTextStream s(device); - s << "/* XPM */" << endl - << "static char *" << fbname(fileName) << "[]={" << endl + s << "/* XPM */" << Qt::endl + << "static char *" << fbname(fileName) << "[]={" << Qt::endl << '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"'; // write palette @@ -1147,7 +1147,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const qGreen(color), qBlue(color)); ++c; - s << ',' << endl << line; + s << ',' << Qt::endl << line; } // write pixels, limit to 4 characters per pixel @@ -1169,9 +1169,9 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const } } } - s << ',' << endl << '\"' << line << '\"'; + s << ',' << Qt::endl << '\"' << line << '\"'; } - s << "};" << endl; + s << "};" << Qt::endl; return (s.status() == QTextStream::Ok); } diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index f6d1da45e3..563eab4655 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3764,13 +3764,13 @@ static inline void formatTouchEvent(QDebug d, const QTouchEvent &t) static void formatUnicodeString(QDebug d, const QString &s) { - d << '"' << hex; + d << '"' << Qt::hex; for (int i = 0; i < s.size(); ++i) { if (i) d << ','; d << "U+" << s.at(i).unicode(); } - d << dec << '"'; + d << Qt::dec << '"'; } static inline void formatInputMethodEvent(QDebug d, const QInputMethodEvent *e) @@ -3807,8 +3807,8 @@ static inline void formatInputMethodQueryEvent(QDebug d, const QInputMethodQuery QDebugStateSaver saver(d); d.noquote(); const Qt::InputMethodQueries queries = e->queries(); - d << "QInputMethodQueryEvent(queries=" << showbase << hex << int(queries) - << noshowbase << dec << ", {"; + d << "QInputMethodQueryEvent(queries=" << Qt::showbase << Qt::hex << int(queries) + << Qt::noshowbase << Qt::dec << ", {"; for (unsigned mask = 1; mask <= Qt::ImInputItemClipRectangle; mask<<=1) { if (queries & mask) { const Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>(mask); @@ -4001,7 +4001,7 @@ QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &tp) { QDebugStateSaver saver(dbg); dbg.nospace(); - dbg << "TouchPoint(" << hex << tp.id() << dec << " ("; + dbg << "TouchPoint(" << Qt::hex << tp.id() << Qt::dec << " ("; QtDebugUtils::formatQPoint(dbg, tp.pos()); dbg << ") "; QtDebugUtils::formatQEnum(dbg, tp.state()); diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index b4383c5bfc..f6e5fa0a52 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -1204,7 +1204,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p) QDebugStateSaver saver(dbg); QDebug nospace = dbg.nospace(); const uint mask = p.resolve(); - nospace << "QPalette(resolve=" << hex << showbase << mask << ','; + nospace << "QPalette(resolve=" << Qt::hex << Qt::showbase << mask << ','; for (int role = 0; role < (int)QPalette::NColorRoles; ++role) { if (mask & (1<<role)) { if (role) @@ -1220,7 +1220,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p) nospace << ']'; } } - nospace << ')' << noshowbase << dec; + nospace << ')' << Qt::noshowbase << Qt::dec; return dbg; } #endif diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index 952023dd1b..c79f597414 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -768,7 +768,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height) static inline void formatRect(QDebug &debug, const QRect r) { debug << r.width() << 'x' << r.height() - << forcesign << r.x() << r.y() << noforcesign; + << Qt::forcesign << r.x() << r.y() << Qt::noforcesign; } Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 19a5d39ad5..88e76a53f7 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2835,13 +2835,13 @@ QDebug operator<<(QDebug debug, const QWindow *window) if (window->isTopLevel()) debug << ", toplevel"; debug << ", " << geometry.width() << 'x' << geometry.height() - << forcesign << geometry.x() << geometry.y() << noforcesign; + << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign; const QMargins margins = window->frameMargins(); if (!margins.isNull()) debug << ", margins=" << margins; debug << ", devicePixelRatio=" << window->devicePixelRatio(); if (const QPlatformWindow *platformWindow = window->handle()) - debug << ", winId=0x" << hex << platformWindow->winId() << dec; + debug << ", winId=0x" << Qt::hex << platformWindow->winId() << Qt::dec; if (const QScreen *screen = window->screen()) debug << ", on " << screen->name(); } diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 6a2a9e5bae..692c29c996 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -351,11 +351,11 @@ QDebug operator<<(QDebug dbg, const QGenericMatrix<N, M, T> &m) QDebugStateSaver saver(dbg); dbg.nospace() << "QGenericMatrix<" << N << ", " << M << ", " << QTypeInfo<T>::name() - << ">(" << endl << qSetFieldWidth(10); + << ">(" << Qt::endl << qSetFieldWidth(10); for (int row = 0; row < M; ++row) { for (int col = 0; col < N; ++col) dbg << m(row, col); - dbg << endl; + dbg << Qt::endl; } dbg << qSetFieldWidth(0) << ')'; return dbg; diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp index 045fa210c4..ad4cdfdbf4 100644 --- a/src/gui/math3d/qmatrix4x4.cpp +++ b/src/gui/math3d/qmatrix4x4.cpp @@ -2037,12 +2037,12 @@ QDebug operator<<(QDebug dbg, const QMatrix4x4 &m) } // Output in row-major order because it is more human-readable. - dbg.nospace() << "QMatrix4x4(type:" << bits.constData() << endl + dbg.nospace() << "QMatrix4x4(type:" << bits.constData() << Qt::endl << qSetFieldWidth(10) - << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) << endl - << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) << endl - << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) << endl - << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << endl + << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) << Qt::endl + << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) << Qt::endl + << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) << Qt::endl + << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << Qt::endl << qSetFieldWidth(0) << ')'; return dbg; } diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index 2b1e57a4bb..6b701fe52b 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -136,7 +136,7 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g) d.nospace(); d << "Gpu("; if (g.isValid()) { - d << "vendor=" << hex << showbase <<g.vendorId << ", device=" << g.deviceId + d << "vendor=" << Qt::hex << Qt::showbase <<g.vendorId << ", device=" << g.deviceId << "version=" << g.driverVersion; } else { d << 0; diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 5ea78cdde2..080da98ec4 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -71,10 +71,10 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl, const int ix = 0x00010000 * sx; const int iy = 0x00010000 * sy; -// qDebug() << "scale:" << endl -// << " - target" << targetRect << endl -// << " - source" << srcRect << endl -// << " - clip" << clip << endl +// qDebug() << "scale:" << Qt::endl +// << " - target" << targetRect << Qt::endl +// << " - source" << srcRect << Qt::endl +// << " - clip" << clip << Qt::endl // << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy; QRect tr = targetRect.normalized().toRect(); @@ -162,10 +162,10 @@ template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl, const int ix = 0x00010000 * sx; const int iy = 0x00010000 * sy; -// qDebug() << "scale:" << endl -// << " - target" << targetRect << endl -// << " - source" << srcRect << endl -// << " - clip" << clip << endl +// qDebug() << "scale:" << Qt::endl +// << " - target" << targetRect << Qt::endl +// << " - source" << srcRect << Qt::endl +// << " - clip" << clip << Qt::endl // << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy; QRect tr = targetRect.normalized().toRect(); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 003842965d..85ddff53db 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -898,7 +898,7 @@ void QRasterPaintEngine::renderHintsChanged() QRasterPaintEngineState *s = state(); #ifdef QT_DEBUG_DRAW - qDebug() << "QRasterPaintEngine::renderHintsChanged()" << hex << s->renderHints; + qDebug() << "QRasterPaintEngine::renderHintsChanged()" << Qt::hex << s->renderHints; #endif bool was_aa = s->flags.antialiased; @@ -1745,7 +1745,7 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush) QRectF rf = path.controlPointRect(); qDebug() << "QRasterPaintEngine::fill(): " << "size=" << path.elementCount() - << ", hints=" << hex << path.hints() + << ", hints=" << Qt::hex << path.hints() << rf << brush; #endif diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 22d3fb3001..8314e8bc8a 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -140,7 +140,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path) QDebugStateSaver saver(s); QRectF rf = path.controlPointRect(); s << "QVectorPath(size:" << path.elementCount() - << " hints:" << hex << path.hints() + << " hints:" << Qt::hex << path.hints() << rf << ')'; return s; } diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 649cfd554b..7eaa4b6e3f 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -3576,10 +3576,10 @@ void QPainterPath::computeControlPointRect() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug s, const QPainterPath &p) { - s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl; + s.nospace() << "QPainterPath: Element count=" << p.elementCount() << Qt::endl; const char *types[] = {"MoveTo", "LineTo", "CurveTo", "CurveToData"}; for (int i=0; i<p.elementCount(); ++i) { - s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl; + s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << Qt::endl; } return s; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 1719855e68..99c9e1bfdc 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1213,7 +1213,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor) end: std::sort(kerning_pairs.begin(), kerning_pairs.end()); // for (int i = 0; i < kerning_pairs.count(); ++i) -// qDebug() << 'i' << i << "left_right" << hex << kerning_pairs.at(i).left_right; +// qDebug() << 'i' << i << "left_right" << Qt::hex << kerning_pairs.at(i).left_right; } diff --git a/src/gui/text/qfontengine_qpf2.cpp b/src/gui/text/qfontengine_qpf2.cpp index 110d512d39..409176d41b 100644 --- a/src/gui/text/qfontengine_qpf2.cpp +++ b/src/gui/text/qfontengine_qpf2.cpp @@ -140,9 +140,9 @@ static inline const uchar *verifyTag(const uchar *tagPtr, const uchar *endPtr) } #if defined(DEBUG_HEADER) if (length == 1) - qDebug() << "tag data" << hex << *tagPtr; + qDebug() << "tag data" << Qt::hex << *tagPtr; else if (length == 4) - qDebug() << "tag data" << hex << tagPtr[0] << tagPtr[1] << tagPtr[2] << tagPtr[3]; + qDebug() << "tag data" << Qt::hex << tagPtr[0] << tagPtr[1] << tagPtr[2] << tagPtr[3]; #endif } return tagPtr + length; @@ -367,7 +367,7 @@ bool QFontEngineQPF2::stringToCMap(const QChar *str, int len, QGlyphLayout *glyp #if 0 && defined(DEBUG_FONTENGINE) QChar c(uc); if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c)) - qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph; + qDebug() << "glyph for character" << c << '/' << Qt::hex << uc << "is" << Qt::dec << glyphs[glyph_pos].glyph; seenGlyphs.insert(c); #endif diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2616a42022..840448152f 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -990,7 +990,7 @@ struct QBidiAlgorithm { BIDI_DEBUG() << "before implicit level processing:"; IsolatedRunSequenceIterator it(runs, i); while (!it.atEnd()) { - BIDI_DEBUG() << " " << *it << hex << text[*it].unicode() << analysis[*it].bidiDirection; + BIDI_DEBUG() << " " << *it << Qt::hex << text[*it].unicode() << analysis[*it].bidiDirection; ++it; } } @@ -1003,7 +1003,7 @@ struct QBidiAlgorithm { BIDI_DEBUG() << "after W4/W5"; IsolatedRunSequenceIterator it(runs, i); while (!it.atEnd()) { - BIDI_DEBUG() << " " << *it << hex << text[*it].unicode() << analysis[*it].bidiDirection; + BIDI_DEBUG() << " " << *it << Qt::hex << text[*it].unicode() << analysis[*it].bidiDirection; ++it; } } @@ -1089,7 +1089,7 @@ struct QBidiAlgorithm { if (BidiDebugEnabled) { BIDI_DEBUG() << ">>>> start bidi, text length" << length; for (int i = 0; i < length; ++i) - BIDI_DEBUG() << hex << " (" << i << ")" << text[i].unicode() << text[i].direction(); + BIDI_DEBUG() << Qt::hex << " (" << i << ")" << text[i].unicode() << text[i].direction(); } { @@ -1158,7 +1158,7 @@ struct QBidiAlgorithm { if (BidiDebugEnabled) { BIDI_DEBUG() << "final resolved levels:"; for (int i = 0; i < length; ++i) - BIDI_DEBUG() << " " << i << hex << text[i].unicode() << dec << (int)analysis[i].bidiLevel; + BIDI_DEBUG() << " " << i << Qt::hex << text[i].unicode() << Qt::dec << (int)analysis[i].bidiLevel; } return true; |