From 343528841e72adf36a37d9afd7260e260a9342eb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 30 Apr 2019 12:51:36 +0200 Subject: Prefix textstream operators with Qt:: As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp | 2 +- src/3rdparty/harfbuzz/tests/shaping/main.cpp | 4 +- src/corelib/doc/snippets/code/doc_src_qset.cpp | 4 +- .../snippets/code/src_corelib_io_qtextstream.cpp | 4 +- .../snippets/code/src_corelib_thread_qfuture.cpp | 2 +- .../snippets/code/src_corelib_tools_qbytearray.cpp | 6 +- .../doc/snippets/code/src_corelib_tools_qhash.cpp | 28 +- .../code/src_corelib_tools_qlinkedlist.cpp | 8 +- .../snippets/code/src_corelib_tools_qlistdata.cpp | 8 +- .../doc/snippets/code/src_corelib_tools_qmap.cpp | 30 +- .../doc/snippets/code/src_corelib_tools_qqueue.cpp | 2 +- .../code/src_corelib_tools_qstringiterator.cpp | 6 +- .../snippets/code/src_corelib_tools_qvector.cpp | 4 +- src/corelib/doc/snippets/qstack/main.cpp | 2 +- src/corelib/doc/snippets/qstringlist/main.cpp | 6 +- src/corelib/io/qdebug.cpp | 6 +- src/corelib/io/qdebug.h | 2 +- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- src/corelib/io/qfilesystemwatcher_win.cpp | 4 +- src/corelib/kernel/qeventdispatcher_cf.mm | 2 +- src/corelib/kernel/qtimerinfo_unix.cpp | 8 +- src/corelib/plugin/qfactoryloader.cpp | 2 +- src/corelib/serialization/qcborvalue.cpp | 2 +- src/corelib/serialization/qjsonparser.cpp | 2 +- src/corelib/serialization/qtextstream.cpp | 4 +- src/corelib/tools/qstring.cpp | 6 +- src/gui/accessible/qaccessible.cpp | 4 +- src/gui/doc/snippets/textdocumentendsnippet.cpp | 2 +- src/gui/image/qicon.cpp | 2 +- src/gui/image/qpixmap.cpp | 2 +- src/gui/image/qxpmhandler.cpp | 10 +- src/gui/kernel/qevent.cpp | 10 +- src/gui/kernel/qpalette.cpp | 4 +- src/gui/kernel/qscreen.cpp | 2 +- src/gui/kernel/qwindow.cpp | 4 +- src/gui/math3d/qgenericmatrix.h | 4 +- src/gui/math3d/qmatrix4x4.cpp | 10 +- src/gui/opengl/qopengl.cpp | 2 +- src/gui/painting/qblendfunctions_p.h | 16 +- src/gui/painting/qpaintengine_raster.cpp | 4 +- src/gui/painting/qpaintengineex.cpp | 2 +- src/gui/painting/qpainterpath.cpp | 4 +- src/gui/text/qfontengine.cpp | 2 +- src/gui/text/qfontengine_qpf2.cpp | 6 +- src/gui/text/qtextengine.cpp | 8 +- .../freetype/qfreetypefontdatabase.cpp | 2 +- src/plugins/bearer/nla/qnlaengine.cpp | 30 +- src/plugins/platforms/android/androidjnimain.cpp | 2 +- src/plugins/platforms/cocoa/qcocoaaccessibility.mm | 2 +- src/plugins/platforms/cocoa/qnsview_gestures.mm | 10 +- src/plugins/platforms/cocoa/qnsview_touch.mm | 8 +- .../eglfs_kms/qeglfskmsgbmscreen.cpp | 2 +- src/plugins/platforms/windows/qwindowscontext.cpp | 4 +- .../platforms/windows/qwindowsdialoghelpers.cpp | 6 +- src/plugins/platforms/windows/qwindowsdrag.cpp | 8 +- .../platforms/windows/qwindowsglcontext.cpp | 8 +- .../platforms/windows/qwindowsinputcontext.cpp | 4 +- .../platforms/windows/qwindowsintegration.cpp | 6 +- .../platforms/windows/qwindowskeymapper.cpp | 6 +- src/plugins/platforms/windows/qwindowsmenu.cpp | 6 +- .../platforms/windows/qwindowsmousehandler.cpp | 4 +- src/plugins/platforms/windows/qwindowsole.cpp | 6 +- .../platforms/windows/qwindowsopengltester.cpp | 8 +- .../platforms/windows/qwindowspointerhandler.cpp | 20 +- .../platforms/windows/qwindowstabletsupport.cpp | 12 +- src/plugins/platforms/windows/qwindowswindow.cpp | 6 +- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 8 +- src/plugins/platforms/xcb/qxcbscreen.cpp | 6 +- src/sql/doc/snippets/sqldatabase/sqldatabase.cpp | 4 +- src/sql/kernel/qsqlrecord.cpp | 2 +- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 330 ++++++++++----------- src/tools/qlalr/cppgenerator.cpp | 188 ++++++------ src/tools/qlalr/dotgraph.cpp | 22 +- src/tools/qlalr/lalr.cpp | 20 +- src/tools/qlalr/lalr.g | 12 +- src/tools/qlalr/main.cpp | 24 +- src/tools/qlalr/parsetable.cpp | 26 +- src/tools/qlalr/recognizer.cpp | 12 +- src/tools/uic/cpp/cppwriteinitialization.cpp | 10 +- src/widgets/itemviews/qtableview.cpp | 8 +- src/widgets/kernel/qwidget.cpp | 4 +- src/widgets/widgets/qsplitter.cpp | 2 +- src/xml/doc/snippets/code/src_xml_dom_qdom.cpp | 8 +- src/xml/dom/qdom.cpp | 18 +- 84 files changed, 559 insertions(+), 559 deletions(-) (limited to 'src') diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp index 704ea9774a..de3bcb2bbf 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp @@ -1471,7 +1471,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv while (finalOrder[toMove].form && fixed < len-1) { IDEBUG(" fixed = %d, toMove=%d, moving form %d with pos %d", fixed, toMove, finalOrder[toMove].form, finalOrder[toMove].position); for (i = fixed; i < len; i++) { -// IDEBUG() << " i=" << i << "uc=" << hex << uc[i] << "form=" << form(uc[i]) +// IDEBUG() << " i=" << i << "uc=" << Qt::hex << uc[i] << "form=" << form(uc[i]) // << "position=" << position[i]; if (form(uc[i]) == finalOrder[toMove].form && position[i] == finalOrder[toMove].position) { diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp index 10818c565c..16f469029b 100644 --- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp +++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp @@ -370,7 +370,7 @@ void tst_QScriptEngine::greek() QString str; str.append(uc); if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { - //qDebug() << "skipping" << hex << uc; + //qDebug() << "skipping" << Qt::hex << uc; continue; } if (uc == 0x1fc1 || uc == 0x1fed) @@ -389,7 +389,7 @@ void tst_QScriptEngine::greek() QString str; str.append(uc); if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { - //qDebug() << "skipping" << hex << uc; + //qDebug() << "skipping" << Qt::hex << uc; continue; } if (uc == 0x1fc1 || uc == 0x1fed) diff --git a/src/corelib/doc/snippets/code/doc_src_qset.cpp b/src/corelib/doc/snippets/code/doc_src_qset.cpp index 4cd84d7330..7f7cec8b45 100644 --- a/src/corelib/doc/snippets/code/doc_src_qset.cpp +++ b/src/corelib/doc/snippets/code/doc_src_qset.cpp @@ -133,7 +133,7 @@ QSet set; ... QSet::iterator it = qFind(set.begin(), set.end(), "Jeanette"); if (it != set.end()) - cout << "Found Jeanette" << endl; + cout << "Found Jeanette" << Qt::endl; //! [10] @@ -152,7 +152,7 @@ QSet set; ... QSet::iterator it = qFind(set.begin(), set.end(), "Jeanette"); if (it != set.constEnd()) - cout << "Found Jeanette" << endl; + cout << "Found Jeanette" << Qt::endl; //! [12] diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp index 625c1cf9bc..c30f13df5a 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp @@ -124,12 +124,12 @@ in >> ch1 >> ch2 >> ch3; //! [8] QTextStream out(stdout); -out << "Qt rocks!" << endl; +out << "Qt rocks!" << Qt::endl; //! [8] //! [9] -stream << '\n' << flush; +stream << '\n' << Qt::flush; //! [9] diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp index 382b08fdb7..dfa9b670e7 100644 --- a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp @@ -53,7 +53,7 @@ QFuture future = ...; QFuture::const_iterator i; for (i = future.constBegin(); i != future.constEnd(); ++i) - cout << *i << endl; + cout << *i << Qt::endl; //! [0] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index 32fccbefbf..ec63e64fe9 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -71,7 +71,7 @@ ba[4] = 0xca; //! [2] for (int i = 0; i < ba.size(); ++i) { if (ba.at(i) >= 'a' && ba.at(i) <= 'f') - cout << "Found character in range [a-f]" << endl; + cout << "Found character in range [a-f]" << Qt::endl; } //! [2] @@ -88,7 +88,7 @@ x.replace(5, 3, "&"); // x == "rock & roll" QByteArray ba("We must be bold, very bold"); int j = 0; while ((j = ba.indexOf("", j)) != -1) { - cout << "Found tag at index position " << j << endl; + cout << "Found tag at index position " << j << Qt::endl; ++j; } //! [4] @@ -126,7 +126,7 @@ QByteArray("abc").isEmpty(); // returns false QByteArray ba("Hello world"); char *data = ba.data(); while (*data) { - cout << "[" << *data << "]" << endl; + cout << "[" << *data << "]" << Qt::endl; ++data; } //! [8] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp index a3d2dd7f9e..9813cc98d5 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp @@ -89,7 +89,7 @@ QHash hash; ... for (int i = 0; i < 1000; ++i) { if (hash[i] == okButton) - cout << "Found button at index " << i << endl; + cout << "Found button at index " << i << Qt::endl; } //! [6] @@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) { QHashIterator i(hash); while (i.hasNext()) { i.next(); - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; } //! [7] @@ -106,7 +106,7 @@ while (i.hasNext()) { //! [8] QHash::const_iterator i = hash.constBegin(); while (i != hash.constEnd()) { - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; ++i; } //! [8] @@ -122,14 +122,14 @@ hash.insert("plenty", 2000); //! [10] QList values = hash.values("plenty"); for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; + cout << values.at(i) << Qt::endl; //! [10] //! [11] QHash::iterator i = hash.find("plenty"); while (i != hash.end() && i.key() == "plenty") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [11] @@ -139,7 +139,7 @@ while (i != hash.end() && i.key() == "plenty") { QHash hash; ... foreach (int value, hash) - cout << value << endl; + cout << value << Qt::endl; //! [12] @@ -201,7 +201,7 @@ QHash hash; ... QHash::const_iterator i = hash.find("HDR"); while (i != hash.end() && i.key() == "HDR") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [16] @@ -216,7 +216,7 @@ hash.insert("December", 12); QHash::iterator i; for (i = hash.begin(); i != hash.end(); ++i) - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; //! [17] @@ -274,7 +274,7 @@ hash.insert("December", 12); QHash::const_iterator i; for (i = hash.constBegin(); i != hash.constEnd(); ++i) - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; //! [23] @@ -296,23 +296,23 @@ hash3 = hash1 + hash2; //! [25] QList values = hash.values("plenty"); for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; + cout << values.at(i) << Qt::endl; //! [25] //! [26] QMultiHash::iterator i = hash.find("plenty"); while (i != hash.end() && i.key() == "plenty") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [26] //! [27] for (QHash::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) { - cout << "The key: " << it.key() << endl - cout << "The value: " << it.value() << endl; - cout << "Also the value: " << (*it) << endl; + cout << "The key: " << it.key() << Qt::endl + cout << "The value: " << it.value() << Qt::endl; + cout << "Also the value: " << (*it) << Qt::endl; } //! [27] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp index 7f743bbd25..e0d3c71dc5 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp @@ -112,7 +112,7 @@ list.append("December"); QLinkedList::iterator i; for (i = list.begin(); i != list.end(); ++i) - cout << *i << endl; + cout << *i << Qt::endl; //! [7] @@ -122,7 +122,7 @@ QLinkedList list; QLinkedList::iterator it = qFind(list.begin(), list.end(), "Joel"); if (it != list.end()) - cout << "Found Joel" << endl; + cout << "Found Joel" << Qt::endl; //! [8] @@ -182,7 +182,7 @@ list.append("December"); QLinkedList::const_iterator i; for (i = list.constBegin(); i != list.constEnd(); ++i) - cout << *i << endl; + cout << *i << Qt::endl; //! [14] @@ -192,7 +192,7 @@ QLinkedList list; QLinkedList::iterator it = qFind(list.constBegin(), list.constEnd(), "Joel"); if (it != list.constEnd()) - cout << "Found Joel" << endl; + cout << "Found Joel" << Qt::endl; //! [15] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp index 0e746cd6e6..a24e599f2f 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp @@ -73,7 +73,7 @@ if (list[0] == "Bob") //! [3] for (int i = 0; i < list.size(); ++i) { if (list.at(i) == "Jane") - cout << "Found Jane at position " << i << endl; + cout << "Found Jane at position " << i << Qt::endl; } //! [3] @@ -89,7 +89,7 @@ while (!list.isEmpty()) //! [5] int i = list.indexOf("Jane"); if (i != -1) - cout << "First occurrence of Jane is at position " << i << endl; + cout << "First occurrence of Jane is at position " << i << Qt::endl; //! [5] @@ -180,7 +180,7 @@ list.append("December"); QList::iterator i; for (i = list.begin(); i != list.end(); ++i) - cout << *i << endl; + cout << *i << Qt::endl; //! [15] @@ -213,7 +213,7 @@ list.append("December"); QList::const_iterator i; for (i = list.constBegin(); i != list.constEnd(); ++i) - cout << *i << endl; + cout << *i << Qt::endl; //! [19] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp index bd59758f71..506022f082 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp @@ -89,7 +89,7 @@ QMap map; ... for (int i = 0; i < 1000; ++i) { if (map[i] == okButton) - cout << "Found button at index " << i << endl; + cout << "Found button at index " << i << Qt::endl; } //! [6] @@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) { QMapIterator i(map); while (i.hasNext()) { i.next(); - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; } //! [7] @@ -106,7 +106,7 @@ while (i.hasNext()) { //! [8] QMap::const_iterator i = map.constBegin(); while (i != map.constEnd()) { - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; ++i; } //! [8] @@ -122,14 +122,14 @@ map.insert("plenty", 2000); //! [10] QList values = map.values("plenty"); for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; + cout << values.at(i) << Qt::endl; //! [10] //! [11] QMap::iterator i = map.find("plenty"); while (i != map.end() && i.key() == "plenty") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [11] @@ -139,7 +139,7 @@ while (i != map.end() && i.key() == "plenty") { QMap map; ... foreach (int value, map) - cout << value << endl; + cout << value << Qt::endl; //! [12] @@ -175,7 +175,7 @@ QMap map; ... QMap::const_iterator i = map.find("HDR"); while (i != map.end() && i.key() == "HDR") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [14] @@ -201,7 +201,7 @@ QMap map; QMap::const_iterator i = map.lowerBound("HDR"); QMap::const_iterator upperBound = map.upperBound("HDR"); while (i != upperBound) { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [16] @@ -230,7 +230,7 @@ map.insert("December", 12); QMap::iterator i; for (i = map.begin(); i != map.end(); ++i) - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; //! [18] @@ -288,7 +288,7 @@ map.insert("December", 12); QMap::const_iterator i; for (i = map.constBegin(); i != map.constEnd(); ++i) - cout << i.key() << ": " << i.value() << endl; + cout << i.key() << ": " << i.value() << Qt::endl; //! [24] @@ -310,23 +310,23 @@ map3 = map1 + map2; //! [26] QList values = map.values("plenty"); for (int i = 0; i < values.size(); ++i) - cout << values.at(i) << endl; + cout << values.at(i) << Qt::endl; //! [26] //! [27] QMultiMap::iterator i = map.find("plenty"); while (i != map.end() && i.key() == "plenty") { - cout << i.value() << endl; + cout << i.value() << Qt::endl; ++i; } //! [27] //! [keyiterator1] for (QMap::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) { - cout << "The key: " << it.key() << endl - cout << "The value: " << it.value() << endl; - cout << "Also the value: " << (*it) << endl; + cout << "The key: " << it.key() << Qt::endl + cout << "The value: " << it.value() << Qt::endl; + cout << "Also the value: " << (*it) << Qt::endl; } //! [keyiterator1] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp index b74ac31933..6046c73b0f 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp @@ -54,5 +54,5 @@ queue.enqueue(1); queue.enqueue(2); queue.enqueue(3); while (!queue.isEmpty()) - cout << queue.dequeue() << endl; + cout << queue.dequeue() << Qt::endl; //! [0] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp index 7a2b4812ef..eb09fb99e2 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp @@ -72,9 +72,9 @@ while (i.hasNext()) { //! [2] QStringIterator i(u"𝄞 is the G clef"); -qDebug() << hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF) -qDebug() << hex << i.next(); // will print 20 (U+0020, SPACE) -qDebug() << hex << i.next(); // will print 69 (U+0069, LATIN SMALL LETTER I) +qDebug() << Qt::hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF) +qDebug() << Qt::hex << i.next(); // will print 20 (U+0020, SPACE) +qDebug() << Qt::hex << i.next(); // will print 69 (U+0069, LATIN SMALL LETTER I) //! [2] } diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp index 1f2af4a408..a05233049f 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp @@ -73,7 +73,7 @@ if (vector[0] == "Liz") //! [4] for (int i = 0; i < vector.size(); ++i) { if (vector.at(i) == "Alfonso") - cout << "Found Alfonso at position " << i << endl; + cout << "Found Alfonso at position " << i << Qt::endl; } //! [4] @@ -81,7 +81,7 @@ for (int i = 0; i < vector.size(); ++i) { //! [5] int i = vector.indexOf("Harumi"); if (i != -1) - cout << "First occurrence of Harumi is at position " << i << endl; + cout << "First occurrence of Harumi is at position " << i << Qt::endl; //! [5] diff --git a/src/corelib/doc/snippets/qstack/main.cpp b/src/corelib/doc/snippets/qstack/main.cpp index af6b960e57..66823bcb59 100644 --- a/src/corelib/doc/snippets/qstack/main.cpp +++ b/src/corelib/doc/snippets/qstack/main.cpp @@ -60,6 +60,6 @@ int main(int argc, char *argv[]) stack.push(2); stack.push(3); while (!stack.isEmpty()) - cout << stack.pop() << endl; + cout << stack.pop() << Qt::endl; //! [0] } diff --git a/src/corelib/doc/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp index 55c60650fe..80788ccd76 100644 --- a/src/corelib/doc/snippets/qstringlist/main.cpp +++ b/src/corelib/doc/snippets/qstringlist/main.cpp @@ -71,20 +71,20 @@ Widget::Widget(QWidget *parent) //! [1] for (int i = 0; i < fonts.size(); ++i) - cout << fonts.at(i).toLocal8Bit().constData() << endl; + cout << fonts.at(i).toLocal8Bit().constData() << Qt::endl; //! [1] //! [2] QStringListIterator javaStyleIterator(fonts); while (javaStyleIterator.hasNext()) - cout << javaStyleIterator.next().toLocal8Bit().constData() << endl; + cout << javaStyleIterator.next().toLocal8Bit().constData() << Qt::endl; //! [2] //! [3] QStringList::const_iterator constIterator; for (constIterator = fonts.constBegin(); constIterator != fonts.constEnd(); ++constIterator) - cout << (*constIterator).toLocal8Bit().constData() << endl; + cout << (*constIterator).toLocal8Bit().constData() << Qt::endl; //! [3] //! [4] diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 15c5e0ce96..6dc12cd83f 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -166,7 +166,7 @@ void QDebug::putUcs4(uint ucs4) { maybeQuote('\''); if (ucs4 < 0x20) { - stream->ts << "\\x" << hex << ucs4 << reset; + stream->ts << "\\x" << Qt::hex << ucs4 << Qt::reset; } else if (ucs4 < 0x80) { stream->ts << char(ucs4); } else { @@ -174,7 +174,7 @@ void QDebug::putUcs4(uint ucs4) stream->ts << "\\u" << qSetFieldWidth(4); else stream->ts << "\\U" << qSetFieldWidth(8); - stream->ts << hex << qSetPadChar(QLatin1Char('0')) << ucs4 << reset; + stream->ts << Qt::hex << qSetPadChar(QLatin1Char('0')) << ucs4 << Qt::reset; } maybeQuote('\''); } @@ -834,7 +834,7 @@ QDebug &QDebug::resetFormat() that QDebugStateSaver stores for the duration of the current block. The settings of the internal QTextStream are also saved and restored, - so that using << hex in a QDebug operator doesn't affect other QDebug + so that using << Qt::hex in a QDebug operator doesn't affect other QDebug operators. \since 5.1 diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index f9dc4203db..889fb6b571 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -350,7 +350,7 @@ void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, Int value) { const QDebugStateSaver saver(debug); debug.resetFormat(); - debug.nospace() << "QFlags(" << hex << showbase; + debug.nospace() << "QFlags(" << Qt::hex << Qt::showbase; bool needSeparator = false; for (uint i = 0; i < sizeofT * 8; ++i) { if (value & (Int(1) << i)) { diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index a5e629b646..9d008947ba 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -388,7 +388,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify() const inotify_event &event = **it; ++it; - // qDebug() << "inotify event, wd" << event.wd << "mask" << hex << event.mask; + // qDebug() << "inotify event, wd" << event.wd << "mask" << Qt::hex << event.mask; int id = event.wd; QString path = getPathFromID(id); diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index 7f4f9d345b..eb626fd541 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -79,7 +79,7 @@ static Qt::HANDLE createChangeNotification(const QString &path, uint flags) nativePath.append(QLatin1Char('\\')); const HANDLE result = FindFirstChangeNotification(reinterpret_cast(nativePath.utf16()), FALSE, flags); - DEBUG() << __FUNCTION__ << nativePath << hex <" << flags; const Qt::HANDLE fileHandle = createChangeNotification(absolutePath, flags); if (fileHandle != INVALID_HANDLE_VALUE) { diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm index b7b379e2c1..33c231987f 100644 --- a/src/corelib/kernel/qeventdispatcher_cf.mm +++ b/src/corelib/kernel/qeventdispatcher_cf.mm @@ -190,7 +190,7 @@ Q_ENUM_PRINTER(Result); QDebug operator<<(QDebug s, timespec tv) { - s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << reset; + s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << Qt::reset; return s; } diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index c3b8c86063..39010c19cb 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -215,7 +215,7 @@ static timespec roundToMillisecond(timespec val) QDebug operator<<(QDebug s, timeval tv) { QDebugStateSaver saver(s); - s.nospace() << tv.tv_sec << "." << qSetFieldWidth(6) << qSetPadChar(QChar(48)) << tv.tv_usec << reset; + s.nospace() << tv.tv_sec << "." << qSetFieldWidth(6) << qSetPadChar(QChar(48)) << tv.tv_usec << Qt::reset; return s; } QDebug operator<<(QDebug s, Qt::TimerType t) @@ -373,7 +373,7 @@ static void calculateNextTimeout(QTimerInfo *t, timespec currentTime) #ifdef QTIMERINFO_DEBUG if (t->timerType != Qt::PreciseTimer) - qDebug() << "timer" << t->timerType << hex << t->id << dec << "interval" << t->interval + qDebug() << "timer" << t->timerType << Qt::hex << t->id << Qt::dec << "interval" << t->interval << "originally expected at" << t->expected << "will fire at" << t->timeout << "or" << (t->timeout - t->expected) << "s late"; #endif @@ -500,7 +500,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, Qt::TimerType time t->cumulativeError = 0; t->count = 0; if (t->timerType != Qt::PreciseTimer) - qDebug() << "timer" << t->timerType << hex <id << dec << "interval" << t->interval << "expected at" + qDebug() << "timer" << t->timerType << Qt::hex <id << Qt::dec << "interval" << t->interval << "expected at" << t->expected << "will fire first at" << t->timeout; #endif } @@ -620,7 +620,7 @@ int QTimerInfoList::activateTimers() currentTimerInfo->cumulativeError += diff; ++currentTimerInfo->count; if (currentTimerInfo->timerType != Qt::PreciseTimer) - qDebug() << "timer" << currentTimerInfo->timerType << hex << currentTimerInfo->id << dec << "interval" + qDebug() << "timer" << currentTimerInfo->timerType << Qt::hex << currentTimerInfo->id << Qt::dec << "interval" << currentTimerInfo->interval << "firing at" << currentTime << "(orig" << currentTimerInfo->expected << "scheduled at" << currentTimerInfo->timeout << ") off by" << diff << "activation" << currentTimerInfo->count diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 35c64180d4..8e349f23ce 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -239,7 +239,7 @@ void QFactoryLoader::update() library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); if (!library->isPlugin()) { if (qt_debug_component()) { - qDebug() << library->errorString << endl + qDebug() << library->errorString << Qt::endl << " not a plugin"; } library->release(); diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index d469735ae9..b2e0ba6d53 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -2941,7 +2941,7 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v) } if (v.isSimpleType()) return dbg << v.toSimpleType(); - return dbg << "'; + return dbg << "'; } QDebug operator<<(QDebug dbg, const QCborValue &v) { diff --git a/src/corelib/serialization/qjsonparser.cpp b/src/corelib/serialization/qjsonparser.cpp index bfba95520e..f29348d593 100644 --- a/src/corelib/serialization/qjsonparser.cpp +++ b/src/corelib/serialization/qjsonparser.cpp @@ -316,7 +316,7 @@ QJsonDocument Parser::parse(QJsonParseError *error) eatBOM(); char token = nextToken(); - DEBUG << hex << (uint)token; + DEBUG << Qt::hex << (uint)token; if (token == BeginArray) { if (!parseArray()) goto error; diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 0d83bb6cd4..ef2a9c97ee 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -2356,7 +2356,7 @@ void QTextStreamPrivate::putNumber(qulonglong number, bool negative) } else if (negative) { // Workaround for backward compatibility for writing negative // numbers in octal and hex: - // QTextStream(result) << showbase << hex << -1 << oct << -1 + // QTextStream(result) << Qt::showbase << Qt::hex << -1 << oct << -1 // should output: -0x1 -0b1 result = dd->unsLongLongToString(number, -1, base, -1, flags); result.prepend(locale.negativeSign()); @@ -2978,7 +2978,7 @@ QTextStream ¢er(QTextStream &stream) */ QTextStream &endl(QTextStream &stream) { - return stream << QLatin1Char('\n') << flush; + return stream << QLatin1Char('\n') << Qt::flush; } /*! diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 029499039c..93d81b89b6 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -826,9 +826,9 @@ static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QCha uint alast = 0; uint blast = 0; while (a < e) { -// qDebug() << hex << alast << blast; -// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); -// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); +// qDebug() << Qt::hex << alast << blast; +// qDebug() << Qt::hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); +// qDebug() << Qt::hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); int diff = foldCase(a->unicode(), alast) - foldCase(b->unicode(), blast); if ((diff)) return diff; 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(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<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 &m) QDebugStateSaver saver(dbg); dbg.nospace() << "QGenericMatrix<" << N << ", " << M << ", " << QTypeInfo::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 <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 " << 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; diff --git a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp index 4baba64de3..1028d8ec02 100644 --- a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp @@ -127,7 +127,7 @@ QStringList QFreeTypeFontDatabase::addTTFile(const QByteArray &fontData, const Q error = FT_New_Face(library, file.constData(), index, &face); } if (error != FT_Err_Ok) { - qDebug() << "FT_New_Face failed with index" << index << ':' << hex << error; + qDebug() << "FT_New_Face failed with index" << index << ':' << Qt::hex << error; break; } numFaces = face->num_faces; diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp index 726e1efb92..bf10e0cc1f 100644 --- a/src/plugins/bearer/nla/qnlaengine.cpp +++ b/src/plugins/bearer/nla/qnlaengine.cpp @@ -75,38 +75,38 @@ QWindowsSockInit2::~QWindowsSockInit2() #ifdef BEARER_MANAGEMENT_DEBUG static void printBlob(NLA_BLOB *blob) { - qDebug() << "==== BEGIN NLA_BLOB ====" << endl + qDebug() << "==== BEGIN NLA_BLOB ====" << Qt::endl - << "type:" << blob->header.type << endl - << "size:" << blob->header.dwSize << endl + << "type:" << blob->header.type << Qt::endl + << "size:" << blob->header.dwSize << Qt::endl << "next offset:" << blob->header.nextOffset; switch (blob->header.type) { case NLA_RAW_DATA: - qDebug() << "Raw Data" << endl + qDebug() << "Raw Data" << Qt::endl << '\t' << blob->data.rawData; break; case NLA_INTERFACE: - qDebug() << "Interface" << endl - << "\ttype:" << blob->data.interfaceData.dwType << endl - << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl + qDebug() << "Interface" << Qt::endl + << "\ttype:" << blob->data.interfaceData.dwType << Qt::endl + << "\tspeed:" << blob->data.interfaceData.dwSpeed << Qt::endl << "\tadapter:" << blob->data.interfaceData.adapterName; break; case NLA_802_1X_LOCATION: - qDebug() << "802.1x Location" << endl + qDebug() << "802.1x Location" << Qt::endl << '\t' << blob->data.locationData.information; break; case NLA_CONNECTIVITY: - qDebug() << "Connectivity" << endl - << "\ttype:" << blob->data.connectivity.type << endl + qDebug() << "Connectivity" << Qt::endl + << "\ttype:" << blob->data.connectivity.type << Qt::endl << "\tinternet:" << blob->data.connectivity.internet; break; case NLA_ICS: - qDebug() << "ICS" << endl - << "\tspeed:" << blob->data.ICS.remote.speed << endl - << "\ttype:" << blob->data.ICS.remote.type << endl - << "\tstate:" << blob->data.ICS.remote.state << endl - << "\tmachine name:" << blob->data.ICS.remote.machineName << endl + qDebug() << "ICS" << Qt::endl + << "\tspeed:" << blob->data.ICS.remote.speed << Qt::endl + << "\ttype:" << blob->data.ICS.remote.type << Qt::endl + << "\tstate:" << blob->data.ICS.remote.state << Qt::endl + << "\tmachine name:" << blob->data.ICS.remote.machineName << Qt::endl << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; break; default: diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 6ae429b24e..70dde46ffa 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -485,7 +485,7 @@ static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring pa } if (Q_UNLIKELY(!m_main)) { - qCritical() << "dlsym failed:" << dlerror() << endl + qCritical() << "dlsym failed:" << dlerror() << Qt::endl << "Could not find main method"; return false; } diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm index 368cf56c80..db4ec251ae 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm @@ -177,7 +177,7 @@ NSString *macRole(QAccessibleInterface *interface) if (roleMap.isEmpty()) populateRoleMap(); - // MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << hex << qtRole; + // MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << Qt::hex << qtRole; if (roleMap.contains(qtRole)) { // MAC_ACCESSIBILTY_DEBUG() << "return" << roleMap[qtRole]; diff --git a/src/plugins/platforms/cocoa/qnsview_gestures.mm b/src/plugins/platforms/cocoa/qnsview_gestures.mm index 61d551ee0e..f6cd3af4da 100644 --- a/src/plugins/platforms/cocoa/qnsview_gestures.mm +++ b/src/plugins/platforms/cocoa/qnsview_gestures.mm @@ -70,7 +70,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures") if ([self handleGestureAsBeginEnd:event]) return; - qCDebug(lcQpaGestures) << "magnifyWithEvent" << [event magnification] << "from device" << hex << [event deviceID]; + qCDebug(lcQpaGestures) << "magnifyWithEvent" << [event magnification] << "from device" << Qt::hex << [event deviceID]; const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; @@ -85,7 +85,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures") return; static bool zoomIn = true; - qCDebug(lcQpaGestures) << "smartMagnifyWithEvent" << zoomIn << "from device" << hex << [event deviceID]; + qCDebug(lcQpaGestures) << "smartMagnifyWithEvent" << zoomIn << "from device" << Qt::hex << [event deviceID]; const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; @@ -116,7 +116,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures") if (!m_platformWindow) return; - qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY] << "from device" << hex << [event deviceID]; + qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY] << "from device" << Qt::hex << [event deviceID]; const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; @@ -145,7 +145,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures") QPointF windowPoint; QPointF screenPoint; [self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; - qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint << "from device" << hex << [event deviceID]; + qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleGestureEvent(m_platformWindow->window(), QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), timestamp, Qt::BeginNativeGesture, windowPoint, screenPoint); } @@ -155,7 +155,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures") if (!m_platformWindow) return; - qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << hex << [event deviceID]; + qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << Qt::hex << [event deviceID]; const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; diff --git a/src/plugins/platforms/cocoa/qnsview_touch.mm b/src/plugins/platforms/cocoa/qnsview_touch.mm index e789213f70..9330844aec 100644 --- a/src/plugins/platforms/cocoa/qnsview_touch.mm +++ b/src/plugins/platforms/cocoa/qnsview_touch.mm @@ -60,7 +60,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") const NSTimeInterval timestamp = [event timestamp]; const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); - qCDebug(lcQpaTouch) << "touchesBeganWithEvent" << points << "from device" << hex << [event deviceID]; + qCDebug(lcQpaTouch) << "touchesBeganWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points); } @@ -71,7 +71,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") const NSTimeInterval timestamp = [event timestamp]; const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); - qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points << "from device" << hex << [event deviceID]; + qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points); } @@ -82,7 +82,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") const NSTimeInterval timestamp = [event timestamp]; const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); - qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points << "from device" << hex << [event deviceID]; + qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points); } @@ -93,7 +93,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") const NSTimeInterval timestamp = [event timestamp]; const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); - qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points << "from device" << hex << [event deviceID]; + qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points); } diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp index 24051c352e..09a10bcc9c 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp @@ -157,7 +157,7 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface(EGLConfig eglConfig) const auto gbmDevice = static_cast(device())->gbmDevice(); EGLint native_format = -1; EGLBoolean success = eglGetConfigAttrib(display(), eglConfig, EGL_NATIVE_VISUAL_ID, &native_format); - qCDebug(qLcEglfsKmsDebug) << "Got native format" << hex << native_format << dec << "from eglGetConfigAttrib() with return code" << bool(success); + qCDebug(qLcEglfsKmsDebug) << "Got native format" << Qt::hex << native_format << Qt::dec << "from eglGetConfigAttrib() with return code" << bool(success); if (success) m_gbm_surface = gbm_surface_create(gbmDevice, diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 073d6da536..9ab9c2708b 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -590,7 +590,7 @@ QString QWindowsContext::registerWindowClass(QString cname, d->m_registeredWindowClassNames.insert(cname); qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname - << " style=0x" << hex << style << dec + << " style=0x" << Qt::hex << style << Qt::dec << " brush=" << brush << " icon=" << icon << " atom=" << atom; return cname; } @@ -1570,7 +1570,7 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) { if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) { qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=" << hwnd << ' ' << eventName - << " msg=0x" << hex << message << " et=0x" << et << dec << " wp=" + << " msg=0x" << Qt::hex << message << " et=0x" << et << Qt::dec << " wp=" << int(wParam) << " at " << GET_X_LPARAM(lParam) << ',' << GET_Y_LPARAM(lParam) << " handled=" << handled; } diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 9de3268fc8..e0bd38c951 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -736,7 +736,7 @@ QString QWindowsShellItem::libraryItemDefaultSaveFolder(IShellItem *item) #ifndef QT_NO_DEBUG_STREAM void QWindowsShellItem::format(QDebug &d) const { - d << "attributes=0x" << hex << attributes() << dec; + d << "attributes=0x" << Qt::hex << attributes() << Qt::dec; if (isFileSystem()) d << " [filesys]"; if (isDir()) @@ -972,7 +972,7 @@ void QWindowsNativeFileDialogBase::doExec(HWND owner) // gets a WM_CLOSE or the parent window is destroyed. const HRESULT hr = m_fileDialog->Show(owner); QWindowsDialogs::eatMouseMove(); - qCDebug(lcQpaDialogs) << '<' << __FUNCTION__ << " returns " << hex << hr; + qCDebug(lcQpaDialogs) << '<' << __FUNCTION__ << " returns " << Qt::hex << hr; // Emit accepted() only if there is a result as otherwise UI hangs occur. // For example, typing in invalid URLs results in empty result lists. if (hr == S_OK && !m_data.selectedFiles().isEmpty()) { @@ -1013,7 +1013,7 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode, } qCDebug(lcQpaDialogs) << __FUNCTION__ << "mode=" << mode << "acceptMode=" << acceptMode << "options=" << options - << "results in" << showbase << hex << flags; + << "results in" << Qt::showbase << Qt::hex << flags; if (FAILED(m_fileDialog->SetOptions(flags))) qErrnoWarning("%s: SetOptions() failed", __FUNCTION__); diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index 322865b0f3..502c92ef59 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -428,7 +428,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) if (QWindowsContext::verbose > 1 || result != S_OK) { qCDebug(lcQpaMime) << __FUNCTION__ << "fEscapePressed=" << fEscapePressed << "grfKeyState=" << grfKeyState << "buttons" << m_currentButtons - << "returns 0x" << hex << int(result) << dec; + << "returns 0x" << Qt::hex << int(result) << Qt::dec; } return ResultFromScode(result); } @@ -710,7 +710,7 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag) const Qt::DropActions possibleActions = drag->supportedActions(); const DWORD allowedEffects = translateToWinDragEffects(possibleActions); qCDebug(lcQpaMime) << '>' << __FUNCTION__ << "possible Actions=0x" - << hex << int(possibleActions) << "effects=0x" << allowedEffects << dec; + << Qt::hex << int(possibleActions) << "effects=0x" << allowedEffects << Qt::dec; // Indicate message handlers we are in DoDragDrop() event loop. QWindowsDrag::m_dragging = true; const HRESULT r = DoDragDrop(dropDataObject, windowDropSource, allowedEffects, &resultEffect); @@ -734,9 +734,9 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag) dropDataObject->releaseQt(); dropDataObject->Release(); // Will delete obj if refcount becomes 0 windowDropSource->Release(); // Will delete src if refcount becomes 0 - qCDebug(lcQpaMime) << '<' << __FUNCTION__ << hex << "allowedEffects=0x" << allowedEffects + qCDebug(lcQpaMime) << '<' << __FUNCTION__ << Qt::hex << "allowedEffects=0x" << allowedEffects << "reportedPerformedEffect=0x" << reportedPerformedEffect - << " resultEffect=0x" << resultEffect << "hr=0x" << int(r) << dec << "dropAction=" << dragResult; + << " resultEffect=0x" << resultEffect << "hr=0x" << int(r) << Qt::dec << "dropAction=" << dragResult; return dragResult; } diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index e95eaef420..d534ce87cd 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -243,7 +243,7 @@ QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd) QDebugStateSaver saver(d); d.nospace(); d << "PIXELFORMATDESCRIPTOR " - << "dwFlags=" << hex << showbase << pd.dwFlags << dec << noshowbase; + << "dwFlags=" << Qt::hex << Qt::showbase << pd.dwFlags << Qt::dec << Qt::noshowbase; if (pd.dwFlags & PFD_DRAW_TO_WINDOW) d << " PFD_DRAW_TO_WINDOW"; if (pd.dwFlags & PFD_DRAW_TO_BITMAP) d << " PFD_DRAW_TO_BITMAP"; if (pd.dwFlags & PFD_SUPPORT_GDI) d << " PFD_SUPPORT_GDI"; @@ -631,10 +631,10 @@ static int choosePixelFormat(HDC hdc, nsp << __FUNCTION__; if (sampleBuffersRequested) nsp << " samples=" << iAttributes[samplesValuePosition]; - nsp << " Attributes: " << hex << showbase; + nsp << " Attributes: " << Qt::hex << Qt::showbase; for (int ii = 0; ii < i; ++ii) nsp << iAttributes[ii] << ','; - nsp << noshowbase << dec << "\n obtained px #" << pixelFormat + nsp << Qt::noshowbase << Qt::dec << "\n obtained px #" << pixelFormat << " of " << numFormats << "\n " << *obtainedPfd; qCDebug(lcQpaGl) << message; } // Debug @@ -784,7 +784,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, if (!result) { QString message; QDebug(&message).nospace() << __FUNCTION__ << ": wglCreateContextAttribsARB() failed (GL error code: 0x" - << hex << staticContext.opengl32.glGetError() << dec << ") for format: " << format << ", shared context: " << shared; + << Qt::hex << staticContext.opengl32.glGetError() << Qt::dec << ") for format: " << format << ", shared context: " << shared; qErrnoWarning("%s", qPrintable(message)); } return result; diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index 878f55e56b..71ed33f85b 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -657,9 +657,9 @@ void QWindowsInputContext::handleInputLanguageChanged(WPARAM wparam, LPARAM lpar m_locale = qt_localeFromLCID(m_languageId); emitLocaleChanged(); - qCDebug(lcQpaInputMethods) << __FUNCTION__ << hex << showbase + qCDebug(lcQpaInputMethods) << __FUNCTION__ << Qt::hex << Qt::showbase << oldLanguageId << "->" << newLanguageId << "Character set:" - << DWORD(wparam) << dec << noshowbase << m_locale; + << DWORD(wparam) << Qt::dec << Qt::noshowbase << m_locale; } /*! diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 2c90b0484e..e896f9f0ee 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -324,7 +324,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons if (window->type() == Qt::Desktop) { QWindowsDesktopWindow *result = new QWindowsDesktopWindow(window); qCDebug(lcQpaWindows) << "Desktop window:" << window - << showbase << hex << result->winId() << noshowbase << dec << result->geometry(); + << Qt::showbase << Qt::hex << result->winId() << Qt::noshowbase << Qt::dec << result->geometry(); return result; } @@ -373,8 +373,8 @@ QPlatformWindow *QWindowsIntegration::createForeignWindow(QWindow *window, WId n screen = pScreen->screen(); if (screen && screen != window->screen()) window->setScreen(screen); - qCDebug(lcQpaWindows) << "Foreign window:" << window << showbase << hex - << result->winId() << noshowbase << dec << obtainedGeometry << screen; + qCDebug(lcQpaWindows) << "Foreign window:" << window << Qt::showbase << Qt::hex + << result->winId() << Qt::noshowbase << Qt::dec << obtainedGeometry << screen; return result; } diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index c5af4d8042..44668cde78 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -554,7 +554,7 @@ QDebug operator<<(QDebug d, const KeyboardLayoutItem &k) if (const quint32 qtKey = k.qtKey[i]) { d << '[' << i << ' '; QtDebugUtils::formatQFlags(d, ModsTbl[i]); - d << ' ' << hex << showbase << qtKey << dec << noshowbase << ' '; + d << ' ' << Qt::hex << Qt::showbase << qtKey << Qt::dec << Qt::noshowbase << ' '; QtDebugUtils::formatQEnum(d, Qt::Key(qtKey)); if (qtKey >= 32 && qtKey < 128) d << " '" << char(qtKey) << '\''; @@ -776,7 +776,7 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 ::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast(&buffer), 0); } qCDebug(lcQpaEvents) << __FUNCTION__ << "for virtual key=" - << hex << showbase << vk_key << dec << noshowbase << keyLayout[vk_key]; + << Qt::hex << Qt::showbase << vk_key << Qt::dec << Qt::noshowbase << keyLayout[vk_key]; } static inline QString messageKeyText(const MSG &msg) @@ -1384,7 +1384,7 @@ QList QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const } } qCDebug(lcQpaEvents) << __FUNCTION__ << e << "nativeVirtualKey=" - << showbase << hex << e->nativeVirtualKey() << dec << noshowbase + << Qt::showbase << Qt::hex << e->nativeVirtualKey() << Qt::dec << Qt::noshowbase << e->modifiers() << kbItem << "\n returns" << formatKeys(result); return result; } diff --git a/src/plugins/platforms/windows/qwindowsmenu.cpp b/src/plugins/platforms/windows/qwindowsmenu.cpp index 17a1b94101..e55e283fe1 100644 --- a/src/plugins/platforms/windows/qwindowsmenu.cpp +++ b/src/plugins/platforms/windows/qwindowsmenu.cpp @@ -896,8 +896,8 @@ void QWindowsMenuItem::formatDebug(QDebug &d) const d << ", parentMenu=" << static_cast(m_parentMenu); if (m_subMenu) d << ", subMenu=" << static_cast(m_subMenu); - d << ", tag=" << showbase << hex - << tag() << noshowbase << dec << ", id=" << m_id; + d << ", tag=" << Qt::showbase << Qt::hex + << tag() << Qt::noshowbase << Qt::dec << ", id=" << m_id; #if QT_CONFIG(shortcut) if (!m_shortcut.isEmpty()) d << ", shortcut=" << m_shortcut; @@ -933,7 +933,7 @@ void QWindowsMenu::formatDebug(QDebug &d) const if (m_parentMenu != nullptr) d << " [on menu]"; if (tag()) - d << ", tag=" << showbase << hex << tag() << noshowbase << dec; + d << ", tag=" << Qt::showbase << Qt::hex << tag() << Qt::noshowbase << Qt::dec; if (m_visible) d << " [visible]"; if (m_enabled) diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 737fd1d2a9..c4d53855a5 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -124,8 +124,8 @@ static inline QTouchDevice *createTouchDevice() return nullptr; const int tabletPc = GetSystemMetrics(SM_TABLETPC); const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES); - qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY) - << "Ready:" << (digitizers & NID_READY) << dec << noshowbase + qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY) + << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase << "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints; QTouchDevice *result = new QTouchDevice; result->setType(digitizers & NID_INTEGRATED_TOUCH diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp index e9c3f2cbf6..fb6a74581a 100644 --- a/src/plugins/platforms/windows/qwindowsole.cpp +++ b/src/plugins/platforms/windows/qwindowsole.cpp @@ -110,7 +110,7 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium) } if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled()) - qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << hex << showbase << quint64(hr); + qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << Qt::hex << Qt::showbase << quint64(hr); return hr; } @@ -135,7 +135,7 @@ QWindowsOleDataObject::QueryGetData(LPFORMATETC pformatetc) ResultFromScode(S_OK) : ResultFromScode(S_FALSE); } if (QWindowsContext::verbose > 1) - qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr); + qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr); return hr; } @@ -163,7 +163,7 @@ QWindowsOleDataObject::SetData(LPFORMATETC pFormatetc, STGMEDIUM *pMedium, BOOL hr = ResultFromScode(S_OK); } if (QWindowsContext::verbose > 1) - qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr); + qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr); return hr; } diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp index 840a3a11c4..35418a18e7 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.cpp +++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp @@ -188,9 +188,9 @@ QDebug operator<<(QDebug d, const GpuDescription &gd) { QDebugStateSaver s(d); d.nospace(); - d << hex << showbase << "GpuDescription(vendorId=" << gd.vendorId + d << Qt::hex << Qt::showbase << "GpuDescription(vendorId=" << gd.vendorId << ", deviceId=" << gd.deviceId << ", subSysId=" << gd.subSysId - << dec << noshowbase << ", revision=" << gd.revision + << Qt::dec << Qt::noshowbase << ", revision=" << gd.revision << ", driver: " << gd.driverName << ", version=" << gd.driverVersion << ", " << gd.description << gd.gpuSuitableScreen << ')'; @@ -207,11 +207,11 @@ QString GpuDescription::toString() const << "\n Driver Name : " << driverName << "\n Driver Version : " << driverVersion.toString() << "\n Vendor ID : 0x" << qSetPadChar(QLatin1Char('0')) - << uppercasedigits << hex << qSetFieldWidth(4) << vendorId + << Qt::uppercasedigits << Qt::hex << qSetFieldWidth(4) << vendorId << "\n Device ID : 0x" << qSetFieldWidth(4) << deviceId << "\n SubSys ID : 0x" << qSetFieldWidth(8) << subSysId << "\n Revision ID : 0x" << qSetFieldWidth(4) << revision - << dec; + << Qt::dec; if (!gpuSuitableScreen.isEmpty()) str << "\nGL windows forced to screen: " << gpuSuitableScreen; return result; diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp index 9a8b5d5121..7da87a32d5 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp +++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp @@ -315,8 +315,8 @@ static QTouchDevice *createTouchDevice() return nullptr; const int tabletPc = GetSystemMetrics(SM_TABLETPC); const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES); - qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY) - << "Ready:" << (digitizers & NID_READY) << dec << noshowbase + qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY) + << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase << "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints; QTouchDevice *result = new QTouchDevice; result->setType(digitizers & NID_INTEGRATED_TOUCH @@ -469,19 +469,19 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd, QList touchPoints; if (QWindowsContext::verbose > 1) - qCDebug(lcQpaEvents).noquote().nospace() << showbase + qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase << __FUNCTION__ - << " message=" << hex << msg.message - << " count=" << dec << count; + << " message=" << Qt::hex << msg.message + << " count=" << Qt::dec << count; Qt::TouchPointStates allStates = 0; for (quint32 i = 0; i < count; ++i) { if (QWindowsContext::verbose > 1) - qCDebug(lcQpaEvents).noquote().nospace() << showbase + qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase << " TouchPoint id=" << touchInfo[i].pointerInfo.pointerId << " frame=" << touchInfo[i].pointerInfo.frameId - << " flags=" << hex << touchInfo[i].pointerInfo.pointerFlags; + << " flags=" << Qt::hex << touchInfo[i].pointerInfo.pointerFlags; QWindowSystemInterface::TouchPoint touchPoint; const quint32 pointerId = touchInfo[i].pointerInfo.pointerId; @@ -563,11 +563,11 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin const int z = 0; if (QWindowsContext::verbose > 1) - qCDebug(lcQpaEvents).noquote().nospace() << showbase + qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase << __FUNCTION__ << " sourceDevice=" << sourceDevice << " globalPos=" << globalPos << " localPos=" << localPos << " hiResGlobalPos=" << hiResGlobalPos - << " message=" << hex << msg.message - << " flags=" << hex << penInfo->pointerInfo.pointerFlags; + << " message=" << Qt::hex << msg.message + << " flags=" << Qt::hex << penInfo->pointerInfo.pointerFlags; const QTabletEvent::TabletDevice device = QTabletEvent::Stylus; QTabletEvent::PointerType type; diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index fa209f09c4..84c963af94 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -146,13 +146,13 @@ QDebug operator<<(QDebug d, const LOGCONTEXT &lc) QDebugStateSaver saver(d); d.nospace(); d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x" - << hex << lc.lcOptions << dec; + << Qt::hex << lc.lcOptions << Qt::dec; formatOptions(d, lc.lcOptions); - d << ", status=0x" << hex << lc.lcStatus << ", device=0x" << lc.lcDevice - << dec << ", PktRate=" << lc.lcPktRate + d << ", status=0x" << Qt::hex << lc.lcStatus << ", device=0x" << lc.lcDevice + << Qt::dec << ", PktRate=" << lc.lcPktRate << ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode - << ", MoveMask=0x" << hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask - << ", BtnUpMask=0x" << lc.lcBtnUpMask << dec << ", SysMode=" << lc.lcSysMode + << ", MoveMask=0x" << Qt::hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask + << ", BtnUpMask=0x" << lc.lcBtnUpMask << Qt::dec << ", SysMode=" << lc.lcSysMode << ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ << "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ << ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", " @@ -305,7 +305,7 @@ QString QWindowsTabletSupport::description() const << '.' << (specificationVersion & 0xFF) << " implementation: v" << (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF) << ' ' << devices << " device(s), " << cursors << " cursor(s), " - << extensions << " extensions" << ", options: 0x" << hex << opts << dec; + << extensions << " extensions" << ", options: 0x" << Qt::hex << opts << Qt::dec; formatOptions(str, opts); if (m_tiltSupport) str << " tilt"; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 338e594c7b..d55545af42 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -238,7 +238,7 @@ QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp) QDebugStateSaver saver(d); d.nospace(); d.noquote(); - d << "WINDOWPLACEMENT(flags=0x" << hex << wp.flags << dec << ", showCmd=" + d << "WINDOWPLACEMENT(flags=0x" << Qt::hex << wp.flags << Qt::dec << ", showCmd=" << wp.showCmd << ", ptMinPosition=" << wp.ptMinPosition << ", ptMaxPosition=" << wp.ptMaxPosition << ", rcNormalPosition=" << wp.rcNormalPosition; return d; @@ -248,7 +248,7 @@ QDebug operator<<(QDebug d, const GUID &guid) { QDebugStateSaver saver(d); d.nospace(); - d << '{' << hex << uppercasedigits << qSetPadChar(QLatin1Char('0')) + d << '{' << Qt::hex << Qt::uppercasedigits << qSetPadChar(QLatin1Char('0')) << qSetFieldWidth(8) << guid.Data1 << qSetFieldWidth(0) << '-' << qSetFieldWidth(4) << guid.Data2 << qSetFieldWidth(0) << '-' << qSetFieldWidth(4) @@ -883,7 +883,7 @@ QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle) const QMargins result(qAbs(rect.left), qAbs(rect.top), qAbs(rect.right), qAbs(rect.bottom)); qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << " style=" - << showbase << hex << style << " exStyle=" << exStyle << dec << noshowbase + << Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase << ' ' << rect << ' ' << result; return result; } diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 899081e752..81b889a80f 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -636,13 +636,13 @@ static void dumpNativeWindowsRecursion(const QXcbConnection *connection, xcb_win const QChar oldPadChar =str.padChar(); str.setFieldWidth(8); str.setPadChar(QLatin1Char('0')); - str << hex << window; + str << Qt::hex << window; str.setFieldWidth(oldFieldWidth); str.setPadChar(oldPadChar); - str << dec << " \"" + str << Qt::dec << " \"" << QXcbWindow::windowTitle(connection, window) << "\" " - << geom.width() << 'x' << geom.height() << forcesign << geom.x() << geom.y() - << noforcesign << '\n'; + << geom.width() << 'x' << geom.height() << Qt::forcesign << geom.x() << geom.y() + << Qt::noforcesign << '\n'; auto reply = Q_XCB_REPLY(xcb_query_tree, conn, window); if (reply) { diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 0fa0e8cd7b..bfc105a040 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -915,7 +915,7 @@ QByteArray QXcbScreen::getEdid() const 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; } static inline void formatSizeF(QDebug &debug, const QSizeF s) @@ -929,7 +929,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen) debug.nospace(); debug << "QXcbScreen(" << (const void *)screen; if (screen) { - debug << fixed << qSetRealNumberPrecision(1); + debug << Qt::fixed << qSetRealNumberPrecision(1); debug << ", name=" << screen->name(); debug << ", geometry="; formatRect(debug, screen->geometry()); @@ -947,7 +947,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen) debug << "), orientation=" << screen->orientation(); debug << ", depth=" << screen->depth(); debug << ", refreshRate=" << screen->refreshRate(); - debug << ", root=" << hex << screen->root(); + debug << ", root=" << Qt::hex << screen->root(); debug << ", windowManagerName=" << screen->windowManagerName(); } debug << ')'; diff --git a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp index a27feb1505..bba0487452 100644 --- a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp +++ b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp @@ -213,7 +213,7 @@ void QSqlQuery_snippets() while (i.hasNext()) { i.next(); cout << i.key().toUtf8().data() << ": " - << i.value().toString().toUtf8().data() << endl; + << i.value().toString().toUtf8().data() << Qt::endl; } //! [14] } @@ -223,7 +223,7 @@ void QSqlQuery_snippets() //! [15] QList list = query.boundValues().values(); for (int i = 0; i < list.size(); ++i) - cout << i << ": " << list.at(i).toString().toUtf8().data() << endl; + cout << i << ": " << list.at(i).toString().toUtf8().data() << Qt::endl; //! [15] } } diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp index ecbe3eacdb..c4dc5d1adb 100644 --- a/src/sql/kernel/qsqlrecord.cpp +++ b/src/sql/kernel/qsqlrecord.cpp @@ -535,7 +535,7 @@ QDebug operator<<(QDebug dbg, const QSqlRecord &r) dbg << "QSqlRecord(" << count << ')'; for (int i = 0; i < count; ++i) { dbg.nospace(); - dbg << '\n' << qSetFieldWidth(2) << right << i << left << qSetFieldWidth(0) << ':'; + dbg << '\n' << qSetFieldWidth(2) << Qt::right << i << Qt::left << qSetFieldWidth(0) << ':'; dbg.space(); dbg << r.field(i) << r.value(i).toString(); } diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index ea410cd257..ce4232f3e8 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -161,22 +161,22 @@ static QString moc(const QString &name) static QTextStream &writeHeader(QTextStream &ts, bool changesWillBeLost) { - ts << "/*" << endl - << " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << endl - << " * Command line was: " << commandLine << endl - << " *" << endl - << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << endl - << " *" << endl - << " * This is an auto-generated file." << endl; + ts << "/*" << Qt::endl + << " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << Qt::endl + << " * Command line was: " << commandLine << Qt::endl + << " *" << Qt::endl + << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << Qt::endl + << " *" << Qt::endl + << " * This is an auto-generated file." << Qt::endl; if (changesWillBeLost) - ts << " * Do not edit! All changes made to it will be lost." << endl; + ts << " * Do not edit! All changes made to it will be lost." << Qt::endl; else - ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << endl - << " * before re-generating it." << endl; + ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << Qt::endl + << " * before re-generating it." << Qt::endl; - ts << " */" << endl - << endl; + ts << " */" << Qt::endl + << Qt::endl; return ts; } @@ -466,66 +466,66 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf } includeGuard = QString(QLatin1String("%1")) .arg(includeGuard); - hs << "#ifndef " << includeGuard << endl - << "#define " << includeGuard << endl - << endl; + hs << "#ifndef " << includeGuard << Qt::endl + << "#define " << includeGuard << Qt::endl + << Qt::endl; // include our stuff: - hs << "#include " << endl + hs << "#include " << Qt::endl << includeList - << "#include " << endl; + << "#include " << Qt::endl; for (const QString &include : qAsConst(includes)) { - hs << "#include \"" << include << "\"" << endl; + hs << "#include \"" << include << "\"" << Qt::endl; if (headerName.isEmpty()) - cs << "#include \"" << include << "\"" << endl; + cs << "#include \"" << include << "\"" << Qt::endl; } - hs << endl; + hs << Qt::endl; if (cppName != headerName) { if (!headerName.isEmpty() && headerName != QLatin1String("-")) - cs << "#include \"" << headerName << "\"" << endl << endl; + cs << "#include \"" << headerName << "\"" << Qt::endl << Qt::endl; } for (const QDBusIntrospection::Interface *interface : interfaces) { QString className = classNameForInterface(interface->name, Proxy); // comment: - hs << "/*" << endl - << " * Proxy class for interface " << interface->name << endl - << " */" << endl; - cs << "/*" << endl - << " * Implementation of interface class " << className << endl - << " */" << endl - << endl; + hs << "/*" << Qt::endl + << " * Proxy class for interface " << interface->name << Qt::endl + << " */" << Qt::endl; + cs << "/*" << Qt::endl + << " * Implementation of interface class " << className << Qt::endl + << " */" << Qt::endl + << Qt::endl; // class header: - hs << "class " << className << ": public QDBusAbstractInterface" << endl - << "{" << endl - << " Q_OBJECT" << endl; + hs << "class " << className << ": public QDBusAbstractInterface" << Qt::endl + << "{" << Qt::endl + << " Q_OBJECT" << Qt::endl; // the interface name - hs << "public:" << endl - << " static inline const char *staticInterfaceName()" << endl - << " { return \"" << interface->name << "\"; }" << endl - << endl; + hs << "public:" << Qt::endl + << " static inline const char *staticInterfaceName()" << Qt::endl + << " { return \"" << interface->name << "\"; }" << Qt::endl + << Qt::endl; // constructors/destructors: - hs << "public:" << endl - << " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << endl - << endl - << " ~" << className << "();" << endl - << endl; - cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << endl - << " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << endl - << "{" << endl - << "}" << endl - << endl - << className << "::~" << className << "()" << endl - << "{" << endl - << "}" << endl - << endl; + hs << "public:" << Qt::endl + << " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << Qt::endl + << Qt::endl + << " ~" << className << "();" << Qt::endl + << Qt::endl; + cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << Qt::endl + << " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << Qt::endl + << "{" << Qt::endl + << "}" << Qt::endl + << Qt::endl + << className << "::~" << className << "()" << Qt::endl + << "{" << Qt::endl + << "}" << Qt::endl + << Qt::endl; // properties: for (const QDBusIntrospection::Property &property : interface->properties) { @@ -545,27 +545,27 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf // it's writeable hs << " WRITE " << setter; - hs << ")" << endl; + hs << ")" << Qt::endl; // getter: if (property.access != QDBusIntrospection::Property::Write) { - hs << " inline " << type << " " << getter << "() const" << endl + hs << " inline " << type << " " << getter << "() const" << Qt::endl << " { return qvariant_cast< " << type << " >(property(\"" - << property.name << "\")); }" << endl; + << property.name << "\")); }" << Qt::endl; } // setter: if (property.access != QDBusIntrospection::Property::Read) { - hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << endl + hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << Qt::endl << " { setProperty(\"" << property.name - << "\", QVariant::fromValue(value)); }" << endl; + << "\", QVariant::fromValue(value)); }" << Qt::endl; } - hs << endl; + hs << Qt::endl; } // methods: - hs << "public Q_SLOTS: // METHODS" << endl; + hs << "public Q_SLOTS: // METHODS" << Qt::endl; for (const QDBusIntrospection::Method &method : interface->methods) { bool isDeprecated = method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == QLatin1String("true"); bool isNoReply = @@ -595,26 +595,26 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf QStringList argNames = makeArgNames(method.inputArgs); writeArgList(hs, argNames, method.annotations, method.inputArgs); - hs << ")" << endl - << " {" << endl - << " QList argumentList;" << endl; + hs << ")" << Qt::endl + << " {" << Qt::endl + << " QList argumentList;" << Qt::endl; if (!method.inputArgs.isEmpty()) { hs << " argumentList"; for (int argPos = 0; argPos < method.inputArgs.count(); ++argPos) hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')'; - hs << ";" << endl; + hs << ";" << Qt::endl; } if (isNoReply) hs << " callWithArgumentList(QDBus::NoBlock, " - << "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl; + << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl; else hs << " return asyncCallWithArgumentList(QStringLiteral(\"" - << method.name << "\"), argumentList);" << endl; + << method.name << "\"), argumentList);" << Qt::endl; // close the function: - hs << " }" << endl; + hs << " }" << Qt::endl; if (method.outputArgs.count() > 1) { // generate the old-form QDBusReply methods with multiple incoming parameters @@ -627,39 +627,39 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf QStringList argNames = makeArgNames(method.inputArgs, method.outputArgs); writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs); - hs << ")" << endl - << " {" << endl - << " QList argumentList;" << endl; + hs << ")" << Qt::endl + << " {" << Qt::endl + << " QList argumentList;" << Qt::endl; int argPos = 0; if (!method.inputArgs.isEmpty()) { hs << " argumentList"; for (argPos = 0; argPos < method.inputArgs.count(); ++argPos) hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')'; - hs << ";" << endl; + hs << ";" << Qt::endl; } hs << " QDBusMessage reply = callWithArgumentList(QDBus::Block, " - << "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl; + << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl; argPos++; hs << " if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == " - << method.outputArgs.count() << ") {" << endl; + << method.outputArgs.count() << ") {" << Qt::endl; // yes, starting from 1 for (int i = 1; i < method.outputArgs.count(); ++i) hs << " " << argNames.at(argPos++) << " = qdbus_cast<" << templateArg(qtTypeName(method.outputArgs.at(i).type, method.annotations, i, "Out")) - << ">(reply.arguments().at(" << i << "));" << endl; - hs << " }" << endl - << " return reply;" << endl - << " }" << endl; + << ">(reply.arguments().at(" << i << "));" << Qt::endl; + hs << " }" << Qt::endl + << " return reply;" << Qt::endl + << " }" << Qt::endl; } - hs << endl; + hs << Qt::endl; } - hs << "Q_SIGNALS: // SIGNALS" << endl; + hs << "Q_SIGNALS: // SIGNALS" << Qt::endl; for (const QDBusIntrospection::Signal &signal : interface->signals_) { hs << " "; if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == @@ -671,12 +671,12 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf QStringList argNames = makeArgNames(signal.outputArgs); writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); - hs << ");" << endl; // finished for header + hs << ");" << Qt::endl; // finished for header } // close the class: - hs << "};" << endl - << endl; + hs << "};" << Qt::endl + << Qt::endl; } if (!skipNamespaces) { @@ -698,17 +698,17 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf // i parts matched // close last.arguments().count() - i namespaces: for (int j = i; j < last.count(); ++j) - hs << QString((last.count() - j - 1 + i) * 2, QLatin1Char(' ')) << "}" << endl; + hs << QString((last.count() - j - 1 + i) * 2, QLatin1Char(' ')) << "}" << Qt::endl; // open current.arguments().count() - i namespaces for (int j = i; j < current.count(); ++j) - hs << QString(j * 2, QLatin1Char(' ')) << "namespace " << current.at(j) << " {" << endl; + hs << QString(j * 2, QLatin1Char(' ')) << "namespace " << current.at(j) << " {" << Qt::endl; // add this class: if (!name.isEmpty()) { hs << QString(current.count() * 2, QLatin1Char(' ')) << "typedef ::" << classNameForInterface(it->constData()->name, Proxy) - << " " << name << ";" << endl; + << " " << name << ";" << Qt::endl; } if (it == interfaces.constEnd()) @@ -719,12 +719,12 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf } // close the include guard - hs << "#endif" << endl; + hs << "#endif" << Qt::endl; QString mocName = moc(filename); if (includeMocs && !mocName.isEmpty()) - cs << endl - << "#include \"" << mocName << "\"" << endl; + cs << Qt::endl + << "#include \"" << mocName << "\"" << Qt::endl; cs.flush(); hs.flush(); @@ -772,36 +772,36 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte } includeGuard = QString(QLatin1String("%1")) .arg(includeGuard); - hs << "#ifndef " << includeGuard << endl - << "#define " << includeGuard << endl - << endl; + hs << "#ifndef " << includeGuard << Qt::endl + << "#define " << includeGuard << Qt::endl + << Qt::endl; // include our stuff: - hs << "#include " << endl; + hs << "#include " << Qt::endl; if (cppName == headerName) - hs << "#include " << endl - << "#include " << endl; - hs << "#include " << endl; + hs << "#include " << Qt::endl + << "#include " << Qt::endl; + hs << "#include " << Qt::endl; for (const QString &include : qAsConst(includes)) { - hs << "#include \"" << include << "\"" << endl; + hs << "#include \"" << include << "\"" << Qt::endl; if (headerName.isEmpty()) - cs << "#include \"" << include << "\"" << endl; + cs << "#include \"" << include << "\"" << Qt::endl; } if (cppName != headerName) { if (!headerName.isEmpty() && headerName != QLatin1String("-")) - cs << "#include \"" << headerName << "\"" << endl; + cs << "#include \"" << headerName << "\"" << Qt::endl; - cs << "#include " << endl + cs << "#include " << Qt::endl << includeList - << endl; + << Qt::endl; hs << forwardDeclarations; } else { hs << includeList; } - hs << endl; + hs << Qt::endl; QString parent = parentClassName; if (parentClassName.isEmpty()) @@ -811,47 +811,47 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte QString className = classNameForInterface(interface->name, Adaptor); // comment: - hs << "/*" << endl - << " * Adaptor class for interface " << interface->name << endl - << " */" << endl; - cs << "/*" << endl - << " * Implementation of adaptor class " << className << endl - << " */" << endl - << endl; + hs << "/*" << Qt::endl + << " * Adaptor class for interface " << interface->name << Qt::endl + << " */" << Qt::endl; + cs << "/*" << Qt::endl + << " * Implementation of adaptor class " << className << Qt::endl + << " */" << Qt::endl + << Qt::endl; // class header: - hs << "class " << className << ": public QDBusAbstractAdaptor" << endl - << "{" << endl - << " Q_OBJECT" << endl - << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << endl - << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << endl + hs << "class " << className << ": public QDBusAbstractAdaptor" << Qt::endl + << "{" << Qt::endl + << " Q_OBJECT" << Qt::endl + << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << Qt::endl + << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << Qt::endl << stringify(interface->introspection) - << " \"\")" << endl - << "public:" << endl - << " " << className << "(" << parent << " *parent);" << endl - << " virtual ~" << className << "();" << endl - << endl; + << " \"\")" << Qt::endl + << "public:" << Qt::endl + << " " << className << "(" << parent << " *parent);" << Qt::endl + << " virtual ~" << className << "();" << Qt::endl + << Qt::endl; if (!parentClassName.isEmpty()) - hs << " inline " << parent << " *parent() const" << endl - << " { return static_cast<" << parent << " *>(QObject::parent()); }" << endl - << endl; + hs << " inline " << parent << " *parent() const" << Qt::endl + << " { return static_cast<" << parent << " *>(QObject::parent()); }" << Qt::endl + << Qt::endl; // constructor/destructor - cs << className << "::" << className << "(" << parent << " *parent)" << endl - << " : QDBusAbstractAdaptor(parent)" << endl - << "{" << endl - << " // constructor" << endl - << " setAutoRelaySignals(true);" << endl - << "}" << endl - << endl - << className << "::~" << className << "()" << endl - << "{" << endl - << " // destructor" << endl - << "}" << endl - << endl; - - hs << "public: // PROPERTIES" << endl; + cs << className << "::" << className << "(" << parent << " *parent)" << Qt::endl + << " : QDBusAbstractAdaptor(parent)" << Qt::endl + << "{" << Qt::endl + << " // constructor" << Qt::endl + << " setAutoRelaySignals(true);" << Qt::endl + << "}" << Qt::endl + << Qt::endl + << className << "::~" << className << "()" << Qt::endl + << "{" << Qt::endl + << " // destructor" << Qt::endl + << "}" << Qt::endl + << Qt::endl; + + hs << "public: // PROPERTIES" << Qt::endl; for (const QDBusIntrospection::Property &property : interface->properties) { QByteArray type = qtTypeName(property.type, property.annotations); QString constRefType = constRefArg(type); @@ -863,38 +863,38 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte hs << " READ " << getter; if (property.access != QDBusIntrospection::Property::Read) hs << " WRITE " << setter; - hs << ")" << endl; + hs << ")" << Qt::endl; // getter: if (property.access != QDBusIntrospection::Property::Write) { - hs << " " << type << " " << getter << "() const;" << endl; + hs << " " << type << " " << getter << "() const;" << Qt::endl; cs << type << " " - << className << "::" << getter << "() const" << endl - << "{" << endl - << " // get the value of property " << property.name << endl - << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << endl - << "}" << endl - << endl; + << className << "::" << getter << "() const" << Qt::endl + << "{" << Qt::endl + << " // get the value of property " << property.name << Qt::endl + << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << Qt::endl + << "}" << Qt::endl + << Qt::endl; } // setter if (property.access != QDBusIntrospection::Property::Read) { - hs << " void " << setter << "(" << constRefType << "value);" << endl; - cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << endl - << "{" << endl - << " // set the value of property " << property.name << endl + hs << " void " << setter << "(" << constRefType << "value);" << Qt::endl; + cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << Qt::endl + << "{" << Qt::endl + << " // set the value of property " << property.name << Qt::endl << " parent()->setProperty(\"" << property.name << "\", QVariant::fromValue(value"; if (constRefType.contains(QLatin1String("QDBusVariant"))) cs << ".variant()"; - cs << "));" << endl - << "}" << endl - << endl; + cs << "));" << Qt::endl + << "}" << Qt::endl + << Qt::endl; } - hs << endl; + hs << Qt::endl; } - hs << "public Q_SLOTS: // METHODS" << endl; + hs << "public Q_SLOTS: // METHODS" << Qt::endl; for (const QDBusIntrospection::Method &method : interface->methods) { bool isNoReply = method.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true"); @@ -930,10 +930,10 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs); writeArgList(cs, argNames, method.annotations, method.inputArgs, method.outputArgs); - hs << ");" << endl; // finished for header - cs << ")" << endl - << "{" << endl - << " // handle method call " << interface->name << "." << methodName(method) << endl; + hs << ");" << Qt::endl; // finished for header + cs << ")" << Qt::endl + << "{" << Qt::endl + << " // handle method call " << interface->name << "." << methodName(method) << Qt::endl; // make the call bool usingInvokeMethod = false; @@ -945,7 +945,7 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte // we are using QMetaObject::invokeMethod if (!returnType.isEmpty()) cs << " " << returnType << " " << argNames.at(method.inputArgs.count()) - << ";" << endl; + << ";" << Qt::endl; static const char invoke[] = " QMetaObject::invokeMethod(parent(), \""; cs << invoke << name << "\""; @@ -966,10 +966,10 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte << argNames.at(i) << ")"; - cs << ");" << endl; + cs << ");" << Qt::endl; if (!returnType.isEmpty()) - cs << " return " << argNames.at(method.inputArgs.count()) << ";" << endl; + cs << " return " << argNames.at(method.inputArgs.count()) << ";" << Qt::endl; } else { if (parentClassName.isEmpty()) cs << " //"; @@ -997,13 +997,13 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte first = false; } - cs << ");" << endl; + cs << ");" << Qt::endl; } - cs << "}" << endl - << endl; + cs << "}" << Qt::endl + << Qt::endl; } - hs << "Q_SIGNALS: // SIGNALS" << endl; + hs << "Q_SIGNALS: // SIGNALS" << Qt::endl; for (const QDBusIntrospection::Signal &signal : interface->signals_) { hs << " "; if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == @@ -1015,21 +1015,21 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte QStringList argNames = makeArgNames(signal.outputArgs); writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); - hs << ");" << endl; // finished for header + hs << ");" << Qt::endl; // finished for header } // close the class: - hs << "};" << endl - << endl; + hs << "};" << Qt::endl + << Qt::endl; } // close the include guard - hs << "#endif" << endl; + hs << "#endif" << Qt::endl; QString mocName = moc(filename); if (includeMocs && !mocName.isEmpty()) - cs << endl - << "#include \"" << mocName << "\"" << endl; + cs << Qt::endl + << "#include \"" << mocName << "\"" << Qt::endl; cs.flush(); hs.flush(); diff --git a/src/tools/qlalr/cppgenerator.cpp b/src/tools/qlalr/cppgenerator.cpp index 508db696b1..10b2d173ab 100644 --- a/src/tools/qlalr/cppgenerator.cpp +++ b/src/tools/qlalr/cppgenerator.cpp @@ -43,7 +43,7 @@ void generateSeparator(int i, QTextStream &out) if (!(i % 10)) { if (i) out << ","; - out << endl << " "; + out << Qt::endl << " "; } else { out << ", "; } @@ -187,14 +187,14 @@ void CppGenerator::operator () () { if (verbose) qout() << "*** Warning. Found a reduce/reduce conflict in state " << q << " on token ``" << s << "'' between rule " - << r << " and " << -u << endl; + << r << " and " << -u << Qt::endl; ++reduce_reduce_conflict_count; u = qMax (u, -r); if (verbose) - qout() << "\tresolved using rule " << -u << endl; + qout() << "\tresolved using rule " << -u << Qt::endl; } else if (u > 0) @@ -227,7 +227,7 @@ void CppGenerator::operator () () ++shift_reduce_conflict_count; if (verbose) - qout() << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << endl; + qout() << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << Qt::endl; } } } @@ -238,11 +238,11 @@ void CppGenerator::operator () () { if (shift_reduce_conflict_count != grammar.expected_shift_reduce || reduce_reduce_conflict_count != grammar.expected_reduce_reduce) - qerr() << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl; + qerr() << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << Qt::endl; if (verbose) - qout() << endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl - << endl; + qout() << Qt::endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << Qt::endl + << Qt::endl; } QBitArray used_rules (grammar.rules.count ()); @@ -266,7 +266,7 @@ void CppGenerator::operator () () RulePointer rule = grammar.rules.begin () + i; if (rule != grammar.goal) - qerr() << "*** Warning: Rule ``" << *rule << "'' is useless!" << endl; + qerr() << "*** Warning: Rule ``" << *rule << "'' is useless!" << Qt::endl; } } @@ -348,26 +348,26 @@ void CppGenerator::operator () () { out << copyrightHeader() << privateCopyrightHeader() - << endl; + << Qt::endl; } out << "// This file was generated by qlalr - DO NOT EDIT!\n"; - out << startIncludeGuard(grammar.merged_output) << endl; + out << startIncludeGuard(grammar.merged_output) << Qt::endl; if (copyright) { - out << "#if defined(ERROR)" << endl - << "# undef ERROR" << endl - << "#endif" << endl << endl; + out << "#if defined(ERROR)" << Qt::endl + << "# undef ERROR" << Qt::endl + << "#endif" << Qt::endl << Qt::endl; } generateDecl (out); generateImpl (out); out << p.decls(); out << p.impls(); - out << endl; + out << Qt::endl; - out << endIncludeGuard(grammar.merged_output) << endl; + out << endIncludeGuard(grammar.merged_output) << Qt::endl; return; } @@ -388,24 +388,24 @@ void CppGenerator::operator () () { out << copyrightHeader() << privateCopyrightHeader() - << endl; + << Qt::endl; } out << "// This file was generated by qlalr - DO NOT EDIT!\n"; - out << "#ifndef " << prot << endl - << "#define " << prot << endl - << endl; + out << "#ifndef " << prot << Qt::endl + << "#define " << prot << Qt::endl + << Qt::endl; if (copyright) { - out << "#include " << endl << endl; - out << "QT_BEGIN_NAMESPACE" << endl << endl; + out << "#include " << Qt::endl << Qt::endl; + out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl; } generateDecl (out); if (copyright) - out << "QT_END_NAMESPACE" << endl; + out << "QT_END_NAMESPACE" << Qt::endl; - out << "#endif // " << prot << endl << endl; + out << "#endif // " << prot << Qt::endl << Qt::endl; } // end decls { // bits... @@ -419,12 +419,12 @@ void CppGenerator::operator () () out << "// This file was generated by qlalr - DO NOT EDIT!\n"; - out << "#include \"" << declFileName << "\"" << endl << endl; + out << "#include \"" << declFileName << "\"" << Qt::endl << Qt::endl; if (copyright) - out << "QT_BEGIN_NAMESPACE" << endl << endl; + out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl; generateImpl(out); if (copyright) - out << "QT_END_NAMESPACE" << endl; + out << "QT_END_NAMESPACE" << Qt::endl; } // end bits @@ -455,10 +455,10 @@ QString CppGenerator::debugInfoProt() const void CppGenerator::generateDecl (QTextStream &out) { - out << "class " << grammar.table_name << endl - << "{" << endl - << "public:" << endl - << " enum VariousConstants {" << endl; + out << "class " << grammar.table_name << Qt::endl + << "{" << Qt::endl + << "public:" << Qt::endl + << " enum VariousConstants {" << Qt::endl; for (const Name &t : qAsConst(grammar.terminals)) { @@ -474,62 +474,62 @@ void CppGenerator::generateDecl (QTextStream &out) else name.prepend (grammar.token_prefix); - out << " " << name << " = " << value << "," << endl; + out << " " << name << " = " << value << "," << Qt::endl; } - out << endl - << " ACCEPT_STATE = " << accept_state << "," << endl - << " RULE_COUNT = " << grammar.rules.size () << "," << endl - << " STATE_COUNT = " << state_count << "," << endl - << " TERMINAL_COUNT = " << terminal_count << "," << endl - << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << endl - << endl - << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << endl - << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << endl - << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << endl - << " };" << endl - << endl - << " static const char *const spell[];" << endl - << " static const short lhs[];" << endl - << " static const short rhs[];" << endl; + out << Qt::endl + << " ACCEPT_STATE = " << accept_state << "," << Qt::endl + << " RULE_COUNT = " << grammar.rules.size () << "," << Qt::endl + << " STATE_COUNT = " << state_count << "," << Qt::endl + << " TERMINAL_COUNT = " << terminal_count << "," << Qt::endl + << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << Qt::endl + << Qt::endl + << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << Qt::endl + << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << Qt::endl + << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << Qt::endl + << " };" << Qt::endl + << Qt::endl + << " static const char *const spell[];" << Qt::endl + << " static const short lhs[];" << Qt::endl + << " static const short rhs[];" << Qt::endl; if (debug_info) { QString prot = debugInfoProt(); - out << endl << "#ifndef " << prot << endl - << " static const int rule_index[];" << endl - << " static const int rule_info[];" << endl - << "#endif // " << prot << endl << endl; + out << Qt::endl << "#ifndef " << prot << Qt::endl + << " static const int rule_index[];" << Qt::endl + << " static const int rule_info[];" << Qt::endl + << "#endif // " << prot << Qt::endl << Qt::endl; } - out << " static const short goto_default[];" << endl - << " static const short action_default[];" << endl - << " static const short action_index[];" << endl - << " static const short action_info[];" << endl - << " static const short action_check[];" << endl - << endl - << " static inline int nt_action (int state, int nt)" << endl - << " {" << endl - << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << endl - << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << endl - << " return goto_default [nt];" << endl - << endl - << " return action_info [GOTO_INFO_OFFSET + yyn];" << endl - << " }" << endl - << endl - << " static inline int t_action (int state, int token)" << endl - << " {" << endl - << " const int yyn = action_index [state] + token;" << endl - << endl - << " if (yyn < 0 || action_check [yyn] != token)" << endl - << " return - action_default [state];" << endl - << endl - << " return action_info [yyn];" << endl - << " }" << endl - << "};" << endl - << endl - << endl; + out << " static const short goto_default[];" << Qt::endl + << " static const short action_default[];" << Qt::endl + << " static const short action_index[];" << Qt::endl + << " static const short action_info[];" << Qt::endl + << " static const short action_check[];" << Qt::endl + << Qt::endl + << " static inline int nt_action (int state, int nt)" << Qt::endl + << " {" << Qt::endl + << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << Qt::endl + << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << Qt::endl + << " return goto_default [nt];" << Qt::endl + << Qt::endl + << " return action_info [GOTO_INFO_OFFSET + yyn];" << Qt::endl + << " }" << Qt::endl + << Qt::endl + << " static inline int t_action (int state, int token)" << Qt::endl + << " {" << Qt::endl + << " const int yyn = action_index [state] + token;" << Qt::endl + << Qt::endl + << " if (yyn < 0 || action_check [yyn] != token)" << Qt::endl + << " return - action_default [state];" << Qt::endl + << Qt::endl + << " return action_info [yyn];" << Qt::endl + << " }" << Qt::endl + << "};" << Qt::endl + << Qt::endl + << Qt::endl; } void CppGenerator::generateImpl (QTextStream &out) @@ -568,16 +568,16 @@ void CppGenerator::generateImpl (QTextStream &out) { first_nt = false; QString prot = debugInfoProt(); - out << endl << "#ifndef " << prot << endl; + out << Qt::endl << "#ifndef " << prot << Qt::endl; } out << "\"" << *t << "\""; } } if (debug_info) - out << endl << "#endif // " << debugInfoProt() << endl; + out << Qt::endl << "#endif // " << debugInfoProt() << Qt::endl; - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::lhs [] = {"; idx = 0; @@ -587,7 +587,7 @@ void CppGenerator::generateImpl (QTextStream &out) out << aut.id (rule->lhs); } - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::rhs [] = {"; idx = 0; @@ -597,13 +597,13 @@ void CppGenerator::generateImpl (QTextStream &out) out << rule->rhs.size (); } - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; if (debug_info) { QString prot = debugInfoProt(); - out << endl << "#ifndef " << prot << endl; + out << Qt::endl << "#ifndef " << prot << Qt::endl; out << "const int " << grammar.table_name << "::rule_info [] = {"; idx = 0; for (auto rule = grammar.rules.cbegin (); rule != grammar.rules.cend (); ++rule, ++idx) @@ -615,7 +615,7 @@ void CppGenerator::generateImpl (QTextStream &out) for (const Name &n : rule->rhs) out << ", " << name_ids.value (n); } - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const int " << grammar.table_name << "::rule_index [] = {"; idx = 0; @@ -627,8 +627,8 @@ void CppGenerator::generateImpl (QTextStream &out) out << offset; offset += rule->rhs.size () + 1; } - out << endl << "};" << endl - << "#endif // " << prot << endl << endl; + out << Qt::endl << "};" << Qt::endl + << "#endif // " << prot << Qt::endl << Qt::endl; } out << "const short " << grammar.table_name << "::action_default [] = {"; @@ -642,27 +642,27 @@ void CppGenerator::generateImpl (QTextStream &out) else out << "0"; } - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::goto_default [] = {"; generateList(defgoto, out); - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::action_index [] = {"; generateList(compressed_action.index, out); - out << "," << endl; + out << "," << Qt::endl; generateList(compressed_goto.index, out); - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::action_info [] = {"; generateList(compressed_action.info, out); - out << "," << endl; + out << "," << Qt::endl; generateList(compressed_goto.info, out); - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; out << "const short " << grammar.table_name << "::action_check [] = {"; generateList(compressed_action.check, out); - out << "," << endl; + out << "," << Qt::endl; generateList(compressed_goto.check, out); - out << endl << "};" << endl << endl; + out << Qt::endl << "};" << Qt::endl << Qt::endl; } diff --git a/src/tools/qlalr/dotgraph.cpp b/src/tools/qlalr/dotgraph.cpp index 1fa0a1ac77..1d479af2b2 100644 --- a/src/tools/qlalr/dotgraph.cpp +++ b/src/tools/qlalr/dotgraph.cpp @@ -41,9 +41,9 @@ void DotGraph::operator () (Automaton *aut) { Grammar *g = aut->_M_grammar; - out << "digraph {" << endl << endl; + out << "digraph {" << Qt::endl << Qt::endl; - out << "subgraph Includes {" << endl; + out << "subgraph Includes {" << Qt::endl; for (Automaton::IncludesGraph::iterator incl = Automaton::IncludesGraph::begin_nodes (); incl != Automaton::IncludesGraph::end_nodes (); ++incl) { @@ -53,14 +53,14 @@ void DotGraph::operator () (Automaton *aut) out << "\t->\t"; out << "\"(" << aut->id ((*edge)->data.state) << ", " << (*edge)->data.nt << ")\"\t"; out << "[label=\"" << incl->data.state->follows [incl->data.nt] << "\"]"; - out << endl; + out << Qt::endl; } } - out << "}" << endl << endl; + out << "}" << Qt::endl << Qt::endl; - out << "subgraph LRA {" << endl; - //out << "node [shape=record];" << endl << endl; + out << "subgraph LRA {" << Qt::endl; + //out << "node [shape=record];" << Qt::endl << Qt::endl; for (StatePointer q = aut->states.begin (); q != aut->states.end (); ++q) { @@ -74,16 +74,16 @@ void DotGraph::operator () (Automaton *aut) for (ItemPointer item = q->kernel.begin (); item != q->kernel.end (); ++item) out << "| <" << index++ << "> " << *item; - out << "}\"]" << endl; + out << "}\"]" << Qt::endl; for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a) { const char *clr = g->isTerminal (a.key ()) ? "blue" : "red"; - out << "\t" << state << "\t->\t" << aut->id (*a) << "\t[color=\"" << clr << "\",label=\"" << a.key () << "\"]" << endl; + out << "\t" << state << "\t->\t" << aut->id (*a) << "\t[color=\"" << clr << "\",label=\"" << a.key () << "\"]" << Qt::endl; } - out << endl; + out << Qt::endl; } - out << "}" << endl; - out << endl << endl << "}" << endl; + out << "}" << Qt::endl; + out << Qt::endl << Qt::endl << "}" << Qt::endl; } diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp index ec960925aa..2a82eb154e 100644 --- a/src/tools/qlalr/lalr.cpp +++ b/src/tools/qlalr/lalr.cpp @@ -313,7 +313,7 @@ void Automaton::buildNullables () } #ifndef QLALR_NO_DEBUG_NULLABLES - qerr() << "nullables = {" << nullables << endl; + qerr() << "nullables = {" << nullables << Qt::endl; #endif } @@ -456,7 +456,7 @@ void Automaton::buildLookbackSets () lookbacks.insert (item, Lookback (p, A)); #ifndef QLALR_NO_DEBUG_LOOKBACKS - qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << endl; + qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << Qt::endl; #endif } } @@ -487,7 +487,7 @@ void Automaton::buildDirectReads () #ifndef QLALR_NO_DEBUG_DIRECT_READS for (QMap::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr) - qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << endl; + qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << Qt::endl; #endif } } @@ -520,7 +520,7 @@ void Automaton::buildReadsDigraph () dump (qerr(), source); qerr() << " reads "; dump (qerr(), target); - qerr() << endl; + qerr() << Qt::endl; #endif } } @@ -555,7 +555,7 @@ void Automaton::visitReadNode (ReadNode node) _M_reads_stack.push (node); #ifndef QLALR_NO_DEBUG_INCLUDES - // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl; + // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl; #endif for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge) @@ -635,7 +635,7 @@ void Automaton::buildIncludesDigraph () source->insertEdge (target); #ifndef QLALR_NO_DEBUG_INCLUDES - qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl; + qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl; #endif // QLALR_NO_DEBUG_INCLUDES continue; @@ -657,7 +657,7 @@ void Automaton::buildIncludesDigraph () source->insertEdge (target); #ifndef QLALR_NO_DEBUG_INCLUDES - qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl; + qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl; #endif // QLALR_NO_DEBUG_INCLUDES } } @@ -674,7 +674,7 @@ void Automaton::visitIncludeNode (IncludeNode node) _M_includes_stack.push (node); #ifndef QLALR_NO_DEBUG_INCLUDES - // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl; + // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl; #endif for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge) @@ -690,7 +690,7 @@ void Automaton::visitIncludeNode (IncludeNode node) dump (qerr(), node); qerr() << " += follows"; dump (qerr(), r); - qerr() << endl; + qerr() << Qt::endl; #endif NameSet &dst = node->data.state->follows [node->data.nt]; @@ -726,7 +726,7 @@ void Automaton::buildLookaheads () #ifndef QLALR_NO_DEBUG_LOOKAHEADS qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks "; dump (qerr(), lookback); - qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << endl; + qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << Qt::endl; #endif lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ()); diff --git a/src/tools/qlalr/lalr.g b/src/tools/qlalr/lalr.g index 05d30c21fd..a849800dd5 100644 --- a/src/tools/qlalr/lalr.g +++ b/src/tools/qlalr/lalr.g @@ -261,7 +261,7 @@ int Recognizer::nextToken() if (ch == QLatin1Char ('"')) inp (); else - qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl; _M_current_value = text; return (token = STRING_LITERAL); @@ -314,7 +314,7 @@ int Recognizer::nextToken() return (token = PREC); else { - qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << Qt::endl; exit (EXIT_FAILURE); return (token = ERROR); } @@ -659,7 +659,7 @@ case $rule_number: { if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) { - qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl; return false; } @@ -683,7 +683,7 @@ case $rule_number: { if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) { - qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl; return false; } @@ -712,7 +712,7 @@ case $rule_number: { Name tok = _M_grammar->intern (sym(2)); if (! _M_grammar->isTerminal (tok)) { - qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl; + qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << Qt::endl; _M_current_rule->prec = _M_grammar->names.end (); } else @@ -758,7 +758,7 @@ case $rule_number: { } } - qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << Qt::endl; return false; } diff --git a/src/tools/qlalr/main.cpp b/src/tools/qlalr/main.cpp index 5971eb201d..a920b13c85 100644 --- a/src/tools/qlalr/main.cpp +++ b/src/tools/qlalr/main.cpp @@ -44,15 +44,15 @@ static void help_me () { - qerr() << "Usage: qlalr [options] [input file name]" << endl - << endl - << " --help, -h\t\tdisplay this help and exit" << endl - << " --verbose, -v\t\tverbose output" << endl - << " --no-debug\t\tno debug information" << endl - << " --no-lines\t\tno #line directives" << endl - << " --dot\t\t\tgenerate a graph" << endl - << " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << endl - << endl; + qerr() << "Usage: qlalr [options] [input file name]" << Qt::endl + << Qt::endl + << " --help, -h\t\tdisplay this help and exit" << Qt::endl + << " --verbose, -v\t\tverbose output" << Qt::endl + << " --no-debug\t\tno debug information" << Qt::endl + << " --no-lines\t\tno #line directives" << Qt::endl + << " --dot\t\t\tgenerate a graph" << Qt::endl + << " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << Qt::endl + << Qt::endl; exit (0); } @@ -91,7 +91,7 @@ int main (int argc, char *argv[]) file_name = arg; else - qerr() << "*** Warning. Ignore argument `" << arg << "'" << endl; + qerr() << "*** Warning. Ignore argument `" << arg << "'" << Qt::endl; } if (file_name.isEmpty ()) @@ -108,13 +108,13 @@ int main (int argc, char *argv[]) if (grammar.rules.isEmpty ()) { - qerr() << "*** Fatal. No rules!" << endl; + qerr() << "*** Fatal. No rules!" << Qt::endl; exit (EXIT_FAILURE); } else if (grammar.start == grammar.names.end ()) { - qerr() << "*** Fatal. No start symbol!" << endl; + qerr() << "*** Fatal. No start symbol!" << Qt::endl; exit (EXIT_FAILURE); } diff --git a/src/tools/qlalr/parsetable.cpp b/src/tools/qlalr/parsetable.cpp index c88ac1291e..9e71acebb4 100644 --- a/src/tools/qlalr/parsetable.cpp +++ b/src/tools/qlalr/parsetable.cpp @@ -43,13 +43,13 @@ void ParseTable::operator () (Automaton *aut) int rindex = 1; for (RulePointer rule = g->rules.begin (); rule != g->rules.end (); ++rule) - out << rindex++ << ")\t" << *rule << endl; - out << endl << endl; + out << rindex++ << ")\t" << *rule << Qt::endl; + out << Qt::endl << Qt::endl; int index = 0; for (StatePointer state = aut->states.begin (); state != aut->states.end (); ++state) { - out << "state " << index++ << endl << endl; + out << "state " << index++ << Qt::endl << Qt::endl; for (ItemPointer item = state->kernel.begin (); item != state->kernel.end (); ++item) { @@ -58,7 +58,7 @@ void ParseTable::operator () (Automaton *aut) if (item->dot == item->end_rhs ()) out << " " << aut->lookaheads [item]; - out << endl; + out << Qt::endl; } bool first = true; @@ -68,11 +68,11 @@ void ParseTable::operator () (Automaton *aut) continue; if (first) - out << endl; + out << Qt::endl; first = false; - out << " " << *arrow.key () << " shift, and go to state " << std::distance (aut->states.begin (), *arrow) << endl; + out << " " << *arrow.key () << " shift, and go to state " << std::distance (aut->states.begin (), *arrow) << Qt::endl; } first = true; @@ -82,13 +82,13 @@ void ParseTable::operator () (Automaton *aut) continue; if (first) - out << endl; + out << Qt::endl; first = false; const auto lookaheads = aut->lookaheads.value(item); for (const Name &la : lookaheads) - out << " " << *la << " reduce using rule " << aut->id (item->rule) << " (" << *item->rule->lhs << ")" << endl; + out << " " << *la << " reduce using rule " << aut->id (item->rule) << " (" << *item->rule->lhs << ")" << Qt::endl; } first = true; @@ -98,19 +98,19 @@ void ParseTable::operator () (Automaton *aut) continue; if (first) - out << endl; + out << Qt::endl; first = false; - out << " " << *arrow.key () << " go to state " << std::distance (aut->states.begin (), *arrow) << endl; + out << " " << *arrow.key () << " go to state " << std::distance (aut->states.begin (), *arrow) << Qt::endl; } if (state->defaultReduce != g->rules.end ()) { - out << endl - << " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << endl; + out << Qt::endl + << " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << Qt::endl; } - out << endl; + out << Qt::endl; } } diff --git a/src/tools/qlalr/recognizer.cpp b/src/tools/qlalr/recognizer.cpp index ab797c85d0..3da54c0c6a 100644 --- a/src/tools/qlalr/recognizer.cpp +++ b/src/tools/qlalr/recognizer.cpp @@ -97,7 +97,7 @@ int Recognizer::nextToken() if (ch == QLatin1Char ('"')) inp (); else - qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl; _M_current_value = text; return (token = STRING_LITERAL); @@ -150,7 +150,7 @@ int Recognizer::nextToken() return (token = PREC); else { - qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << Qt::endl; exit (EXIT_FAILURE); return (token = ERROR); } @@ -405,7 +405,7 @@ case 34: { if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) { - qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl; return false; } @@ -420,7 +420,7 @@ case 38: { if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) { - qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl; return false; } @@ -443,7 +443,7 @@ case 40: { Name tok = _M_grammar->intern (sym(2)); if (! _M_grammar->isTerminal (tok)) { - qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl; + qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << Qt::endl; _M_current_rule->prec = _M_grammar->names.end (); } else @@ -474,7 +474,7 @@ case 43: { } } - qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl; + qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << Qt::endl; return false; } diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index b8ff91f354..a1ff26ba04 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -1626,7 +1626,7 @@ QString WriteInitialization::writeFontProperties(const DomFont *f) } if (f->hasElementWeight() && f->elementWeight() > 0) { m_output << m_indent << fontName << ".setWeight(" - << f->elementWeight() << ");" << endl; + << f->elementWeight() << ");" << Qt::endl; } if (f->hasElementStrikeOut()) { m_output << m_indent << fontName << ".setStrikeOut(" @@ -2614,7 +2614,7 @@ static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet &directives) @@ -2622,7 +2622,7 @@ static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSetisWindow()) debug << ", window"; debug << ", " << geometry.width() << 'x' << geometry.height() - << forcesign << geometry.x() << geometry.y() << noforcesign; + << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign; if (frameGeometry != geometry) { const QMargins margins(geometry.x() - frameGeometry.x(), geometry.y() - frameGeometry.y(), @@ -13190,7 +13190,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget) } debug << ", devicePixelRatio=" << widget->devicePixelRatioF(); if (const WId wid = widget->internalWinId()) - debug << ", winId=0x" << hex << wid << dec; + debug << ", winId=0x" << Qt::hex << wid << Qt::dec; } debug << ')'; } else { diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index de838a8f93..4e251de501 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -1793,7 +1793,7 @@ void QSplitter::setStretchFactor(int index, int stretch) QTextStream& operator<<(QTextStream& ts, const QSplitter& splitter) { - ts << splitter.saveState() << endl; + ts << splitter.saveState() << Qt::endl; return ts; } diff --git a/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp index 2d18e0e537..f7d81f676f 100644 --- a/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp +++ b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp @@ -74,7 +74,7 @@ QDomNode n = d.firstChild(); while (!n.isNull()) { if (n.isElement()) { QDomElement e = n.toElement(); - cout << "Element name: " << e.tagName() << endl; + cout << "Element name: " << e.tagName() << Qt::endl; break; } n = n.nextSibling(); @@ -126,10 +126,10 @@ QDomElement element4 = document.createElement("MyElement"); QDomElement e = //... //... QDomAttr a = e.attributeNode("href"); -cout << a.value() << endl; // prints "http://qt-project.org" +cout << a.value() << Qt::endl; // prints "http://qt-project.org" a.setValue("http://qt-project.org/doc"); // change the node's attribute QDomAttr a2 = e.attributeNode("href"); -cout << a2.value() << endl; // prints "http://qt-project.org/doc" +cout << a2.value() << Qt::endl; // prints "http://qt-project.org/doc" //! [8] @@ -201,7 +201,7 @@ QDomNode n = docElem.firstChild(); while(!n.isNull()) { QDomElement e = n.toElement(); // try to convert the node to an element. if(!e.isNull()) { - cout << qPrintable(e.tagName()) << endl; // the node really is an element. + cout << qPrintable(e.tagName()) << Qt::endl; // the node really is an element. } n = n.nextSibling(); } diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index cffc1974af..fedd53f3a9 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -3598,7 +3598,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const } if (entities->length()>0 || notations->length()>0) { - s << " [" << endl; + s << " [" << Qt::endl; QHash::const_iterator it2 = notations->map.constBegin(); for (; it2 != notations->map.constEnd(); ++it2) @@ -3611,7 +3611,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const s << ']'; } - s << '>' << endl; + s << '>' << Qt::endl; } /************************************************************** @@ -4627,7 +4627,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const /* -1 disables new lines. */ if (indent != -1) - s << endl; + s << Qt::endl; } QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText()) s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); @@ -4639,7 +4639,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const if (!(next && next->isText())) { /* -1 disables new lines. */ if (indent != -1) - s << endl; + s << Qt::endl; } } @@ -5329,7 +5329,7 @@ void QDomCommentPrivate::save(QTextStream& s, int depth, int indent) const s << "-->"; if (!(next && next->isText())) - s << endl; + s << Qt::endl; } /************************************************************** @@ -5552,7 +5552,7 @@ void QDomNotationPrivate::save(QTextStream& s, int, int) const } else { s << "SYSTEM " << quotedValue(m_sys); } - s << '>' << endl; + s << '>' << Qt::endl; } /************************************************************** @@ -5733,7 +5733,7 @@ void QDomEntityPrivate::save(QTextStream& s, int, int) const _name = QLatin1String("% ") + _name.mid(1); if (m_sys.isNull() && m_pub.isNull()) { - s << "" << endl; + s << "" << Qt::endl; } else { s << "' << endl; + s << '>' << Qt::endl; } } @@ -6014,7 +6014,7 @@ QDomNodePrivate* QDomProcessingInstructionPrivate::cloneNode(bool deep) void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const { - s << "" << endl; + s << "" << Qt::endl; } /************************************************************** -- cgit v1.2.3