Prefix textstream operators with Qt::

As the non prefixed variants are deprecated

Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Lars Knoll 2019-04-30 12:51:36 +02:00
parent 185ba7f4cf
commit 343528841e
96 changed files with 826 additions and 826 deletions

View File

@ -226,7 +226,7 @@ void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, cons
QTextStream out(f); QTextStream out(f);
out << convertFromVariant(contents, Double).toDiagnosticNotation(opts) out << convertFromVariant(contents, Double).toDiagnosticNotation(opts)
<< endl; << Qt::endl;
} }
CborConverter::CborConverter() CborConverter::CborConverter()

View File

@ -66,7 +66,7 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
case QVariant::String: { case QVariant::String: {
const QStringList list = v.toStringList(); const QStringList list = v.toStringList();
for (const QString &s : list) for (const QString &s : list)
out << s << endl; out << s << Qt::endl;
break; break;
} }
@ -80,11 +80,11 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
} }
case QMetaType::Nullptr: case QMetaType::Nullptr:
out << "(null)" << endl; out << "(null)" << Qt::endl;
break; break;
default: default:
out << v.toString() << endl; out << v.toString() << Qt::endl;
break; break;
} }
} }

View File

@ -54,10 +54,10 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
{ {
QFile file(fileName); QFile file(fileName);
out << "Analysis of HTML file: " << fileName << endl; out << "Analysis of HTML file: " << fileName << Qt::endl;
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
out << " Couldn't open the file." << endl << endl << endl; out << " Couldn't open the file." << Qt::endl << Qt::endl << Qt::endl;
return; return;
} }
@ -85,22 +85,22 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
//! [2] //! [2]
if (reader.hasError()) { if (reader.hasError()) {
out << " The HTML file isn't well-formed: " << reader.errorString() out << " The HTML file isn't well-formed: " << reader.errorString()
<< endl << endl << endl; << Qt::endl << Qt::endl << Qt::endl;
return; return;
} }
//! [2] //! [2]
out << " Title: \"" << title << '"' << endl out << " Title: \"" << title << '"' << Qt::endl
<< " Number of paragraphs: " << paragraphCount << endl << " Number of paragraphs: " << paragraphCount << Qt::endl
<< " Number of links: " << links.size() << endl << " Number of links: " << links.size() << Qt::endl
<< " Showing first few links:" << endl; << " Showing first few links:" << Qt::endl;
while (links.size() > 5) while (links.size() > 5)
links.removeLast(); links.removeLast();
for (const QString &link : qAsConst(links)) for (const QString &link : qAsConst(links))
out << " " << link << endl; out << " " << link << Qt::endl;
out << endl << endl; out << Qt::endl << Qt::endl;
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -541,7 +541,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData()); debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf); QTextStream mkt(&mkf);
writeHeader(mkt); writeHeader(mkt);
mkt << "QMAKE = " << var("QMAKE_QMAKE") << endl; mkt << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS") project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS")
<< "@echo 'warning: Xcode project has been regenerated, custom settings have been lost. " \ << "@echo 'warning: Xcode project has been regenerated, custom settings have been lost. " \
"Use CONFIG+=no_autoqmake to prevent this behavior in the future, " \ "Use CONFIG+=no_autoqmake to prevent this behavior in the future, " \
@ -740,15 +740,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData()); debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf); QTextStream mkt(&mkf);
writeHeader(mkt); writeHeader(mkt);
mkt << "MOC = " << var("QMAKE_MOC") << endl; mkt << "MOC = " << var("QMAKE_MOC") << Qt::endl;
mkt << "UIC = " << var("QMAKE_UIC") << endl; mkt << "UIC = " << var("QMAKE_UIC") << Qt::endl;
mkt << "LEX = " << var("QMAKE_LEX") << endl; mkt << "LEX = " << var("QMAKE_LEX") << Qt::endl;
mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl; mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << Qt::endl;
mkt << "YACC = " << var("QMAKE_YACC") << endl; mkt << "YACC = " << var("QMAKE_YACC") << Qt::endl;
mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl; mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << Qt::endl;
mkt << "DEFINES = " mkt << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl; << varGlue("DEFINES","-D"," -D","") << Qt::endl;
mkt << "INCPATH ="; mkt << "INCPATH =";
{ {
const ProStringList &incs = project->values("INCLUDEPATH"); const ProStringList &incs = project->values("INCLUDEPATH");
@ -757,9 +757,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS")) if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
mkt << " " << var("QMAKE_FRAMEWORKPATH_FLAGS"); mkt << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
mkt << endl; mkt << Qt::endl;
mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl; mkt << "MOVE = " << var("QMAKE_MOVE") << Qt::endl << Qt::endl;
mkt << "preprocess: compilers\n"; mkt << "preprocess: compilers\n";
mkt << "clean preprocess_clean: compiler_clean\n\n"; mkt << "clean preprocess_clean: compiler_clean\n\n";
writeExtraTargets(mkt); writeExtraTargets(mkt);
@ -789,7 +789,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} }
} }
} }
mkt << endl; mkt << Qt::endl;
writeExtraCompilerTargets(mkt); writeExtraCompilerTargets(mkt);
writingUnixMakefileGenerator = false; writingUnixMakefileGenerator = false;
} }
@ -994,12 +994,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
tmp = project->values("SUBLIBS"); tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++) for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' '; t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
t << endl << endl; t << Qt::endl << Qt::endl;
mkt << "sublibs: $(SUBLIBS)\n\n"; mkt << "sublibs: $(SUBLIBS)\n\n";
tmp = project->values("SUBLIBS"); tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++) for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t" t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
<< var(ProKey("MAKELIB" + tmp[i])) << endl << endl; << var(ProKey("MAKELIB" + tmp[i])) << Qt::endl << Qt::endl;
mkt.flush(); mkt.flush();
mkf.close(); mkf.close();
writingUnixMakefileGenerator = false; writingUnixMakefileGenerator = false;

View File

@ -994,25 +994,25 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString bdir = Option::output_dir; QString bdir = Option::output_dir;
if(bdir.isEmpty()) if(bdir.isEmpty())
bdir = qmake_getpwd(); bdir = qmake_getpwd();
t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << endl; t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << Qt::endl;
t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << endl; t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << Qt::endl;
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH")) if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl; t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << Qt::endl;
t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << endl; t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_DEFINES")) if(!project->isEmpty("PRL_EXPORT_DEFINES"))
t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl; t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CFLAGS")) if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << endl; t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CXXFLAGS")) if(!project->isEmpty("PRL_EXPORT_CXXFLAGS"))
t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << endl; t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << Qt::endl;
if(!project->isEmpty("CONFIG")) if(!project->isEmpty("CONFIG"))
t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << endl; t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << Qt::endl;
if(!project->isEmpty("TARGET_VERSION_EXT")) if(!project->isEmpty("TARGET_VERSION_EXT"))
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl; t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << Qt::endl;
else if(!project->isEmpty("VERSION")) else if(!project->isEmpty("VERSION"))
t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << endl; t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << Qt::endl;
if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) { if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) {
ProStringList libs; ProStringList libs;
if (!project->isActiveConfig("staticlib")) if (!project->isActiveConfig("staticlib"))
@ -1022,7 +1022,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
t << "QMAKE_PRL_LIBS ="; t << "QMAKE_PRL_LIBS =";
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it) for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
t << qv(project->values((*it).toKey())); t << qv(project->values((*it).toKey()));
t << endl; t << Qt::endl;
} }
} }
@ -1055,15 +1055,15 @@ MakefileGenerator::writeProjectMakefile()
t << "install: "; t << "install: ";
for(it = targets.begin(); it != targets.end(); ++it) for(it = targets.begin(); it != targets.end(); ++it)
t << (*it)->target << "-install "; t << (*it)->target << "-install ";
t << endl; t << Qt::endl;
//uninstall //uninstall
t << "uninstall: "; t << "uninstall: ";
for(it = targets.begin(); it != targets.end(); ++it) for(it = targets.begin(); it != targets.end(); ++it)
t << (*it)->target << "-uninstall "; t << (*it)->target << "-uninstall ";
t << endl; t << Qt::endl;
} else { } else {
t << "first: " << targets.first()->target << endl t << "first: " << targets.first()->target << Qt::endl
<< "install: " << targets.first()->target << "-install\n" << "install: " << targets.first()->target << "-install\n"
<< "uninstall: " << targets.first()->target << "-uninstall\n"; << "uninstall: " << targets.first()->target << "-uninstall\n";
} }
@ -1072,7 +1072,7 @@ MakefileGenerator::writeProjectMakefile()
if(!project->isActiveConfig("no_autoqmake")) { if(!project->isActiveConfig("no_autoqmake")) {
QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName())); QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName()));
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl; t << escapeDependencyPath((*it)->makefile) << ": " << mkf << Qt::endl;
} }
qDeleteAll(targets); qDeleteAll(targets);
return true; return true;
@ -1186,7 +1186,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
p.replace(stringObj, escapeFilePath(dstf)); p.replace(stringObj, escapeFilePath(dstf));
t << "\n\t" << p; t << "\n\t" << p;
} }
t << endl << endl; t << Qt::endl << Qt::endl;
} }
} }
@ -1380,14 +1380,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false); QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false);
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t"; t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
} }
t << target << endl << endl; t << target << Qt::endl << Qt::endl;
if(!uninst.isEmpty()) { if(!uninst.isEmpty()) {
t << "uninstall_" << (*it) << ": FORCE"; t << "uninstall_" << (*it) << ": FORCE";
for (int i = uninst.size(); --i >= 0; ) for (int i = uninst.size(); --i >= 0; )
t << "\n\t" << uninst.at(i); t << "\n\t" << uninst.at(i);
t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n"; t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n";
} }
t << endl; t << Qt::endl;
if (installConfigValues.indexOf("no_default_install") == -1) { if (installConfigValues.indexOf("no_default_install") == -1) {
all_installs += QString("install_") + (*it) + " "; all_installs += QString("install_") + (*it) + " ";
@ -1824,7 +1824,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
t << escapeDependencyPath(targ) << ":" << deps; t << escapeDependencyPath(targ) << ":" << deps;
if(!cmd.isEmpty()) if(!cmd.isEmpty())
t << "\n\t" << cmd; t << "\n\t" << cmd;
t << endl << endl; t << Qt::endl << Qt::endl;
} }
} }
@ -1916,7 +1916,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
FileFixifyFromOutdir)); FileFixifyFromOutdir));
} }
} }
t << endl; t << Qt::endl;
if (config.indexOf("no_clean") == -1) { if (config.indexOf("no_clean") == -1) {
QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList(); QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList();
@ -1981,7 +1981,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
} }
} }
} }
t << endl; t << Qt::endl;
} }
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList(); QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
if (config.indexOf("combine") != -1) { if (config.indexOf("combine") != -1) {
@ -2065,7 +2065,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
} else { } else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(finalizeDependencyPaths(deps)); t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(finalizeDependencyPaths(deps));
} }
t << "\n\t" << cmd << endl << endl; t << "\n\t" << cmd << Qt::endl << Qt::endl;
continue; continue;
} }
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
@ -2177,10 +2177,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
++i; ++i;
} }
t << escapeDependencyPath(out) << ": " << valList(finalizeDependencyPaths(deps)) << "\n\t" t << escapeDependencyPath(out) << ": " << valList(finalizeDependencyPaths(deps)) << "\n\t"
<< cmd << endl << endl; << cmd << Qt::endl << Qt::endl;
} }
} }
t << "compiler_clean: " << clean_targets << endl << endl; t << "compiler_clean: " << clean_targets << Qt::endl << Qt::endl;
} }
void void
@ -2196,17 +2196,17 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
first = false; first = false;
} }
t << "QMAKE_COMP_" << (*varit) << " = " t << "QMAKE_COMP_" << (*varit) << " = "
<< valList(project->values((*varit).toKey())) << endl; << valList(project->values((*varit).toKey())) << Qt::endl;
} }
} }
if(!first) if(!first)
t << endl; t << Qt::endl;
} }
void void
MakefileGenerator::writeExtraVariables(QTextStream &t) MakefileGenerator::writeExtraVariables(QTextStream &t)
{ {
t << endl; t << Qt::endl;
ProStringList outlist; ProStringList outlist;
const ProValueMap &vars = project->variables(); const ProValueMap &vars = project->variables();
@ -2220,7 +2220,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
} }
if (!outlist.isEmpty()) { if (!outlist.isEmpty()) {
t << "####### Custom Variables\n"; t << "####### Custom Variables\n";
t << outlist.join('\n') << endl << endl; t << outlist.join('\n') << Qt::endl << Qt::endl;
} }
} }
@ -2236,11 +2236,11 @@ MakefileGenerator::writeExportedVariables(QTextStream &t)
const ProString &name = project->first(ProKey(exp + ".name")); const ProString &name = project->first(ProKey(exp + ".name"));
const ProString &value = project->first(ProKey(exp + ".value")); const ProString &value = project->first(ProKey(exp + ".value"));
if (!value.isEmpty()) if (!value.isEmpty())
t << name << " = " << value << endl; t << name << " = " << value << Qt::endl;
else else
t << name << " =\n"; t << name << " =\n";
} }
t << endl; t << Qt::endl;
} }
bool bool
@ -2248,7 +2248,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
{ {
if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty())
return false; return false;
t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " "; t << *it << " ";
@ -2264,7 +2264,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
bool bool
MakefileGenerator::writeStubMakefile(QTextStream &t) MakefileGenerator::writeStubMakefile(QTextStream &t)
{ {
t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " "; t << *it << " ";
@ -2293,22 +2293,22 @@ MakefileGenerator::writeMakefile(QTextStream &t)
void void
MakefileGenerator::writeDefaultVariables(QTextStream &t) MakefileGenerator::writeDefaultVariables(QTextStream &t)
{ {
t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
t << "MKDIR = " << var("QMAKE_MKDIR") << endl; t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
t << "COPY = " << var("QMAKE_COPY") << endl; t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl; t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl; t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl; t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl; t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl; t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl; t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl; t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << Qt::endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
t << "MOVE = " << var("QMAKE_MOVE") << endl; t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
} }
QString MakefileGenerator::buildArgs(bool withExtra) QString MakefileGenerator::buildArgs(bool withExtra)
@ -2349,18 +2349,18 @@ void
MakefileGenerator::writeHeader(QTextStream &t) MakefileGenerator::writeHeader(QTextStream &t)
{ {
t << "#############################################################################\n"; t << "#############################################################################\n";
t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl; t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << Qt::endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n"; t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n";
t << "# Project: " << fileFixify(project->projectFile()) << endl; t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl;
t << "# Template: " << var("TEMPLATE") << endl; t << "# Template: " << var("TEMPLATE") << Qt::endl;
if(!project->isActiveConfig("build_pass")) if(!project->isActiveConfig("build_pass"))
t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << endl; t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << Qt::endl;
t << "#############################################################################\n"; t << "#############################################################################\n";
t << endl; t << Qt::endl;
QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if (ofile.lastIndexOf(Option::dir_sep) != -1) if (ofile.lastIndexOf(Option::dir_sep) != -1)
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl; t << "MAKEFILE = " << escapeFilePath(ofile) << Qt::endl << Qt::endl;
t << "EQ = =\n\n"; t << "EQ = =\n\n";
} }
@ -2492,7 +2492,7 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix, void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments) const QString &makeArguments)
{ {
t << callPrefix << "$(MAKE)" << makeArguments << endl; t << callPrefix << "$(MAKE)" << makeArguments << Qt::endl;
} }
void void
@ -2517,14 +2517,14 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
// blasted includes // blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES"); const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it) for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
t << "include " << (*qeui_it) << endl; t << "include " << (*qeui_it) << Qt::endl;
if (!(flags & SubTargetSkipDefaultVariables)) { if (!(flags & SubTargetSkipDefaultVariables)) {
writeDefaultVariables(t); writeDefaultVariables(t);
t << "SUBTARGETS = "; // subtargets are sub-directory t << "SUBTARGETS = "; // subtargets are sub-directory
for(int target = 0; target < targets.size(); ++target) for(int target = 0; target < targets.size(); ++target)
t << " \\\n\t\t" << targets.at(target)->target; t << " \\\n\t\t" << targets.at(target)->target;
t << endl << endl; t << Qt::endl << Qt::endl;
} }
writeExtraVariables(t); writeExtraVariables(t);
@ -2580,7 +2580,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if (!dont_recurse) if (!dont_recurse)
writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all"); writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all");
else else
t << endl; t << Qt::endl;
} }
{ //actually compile { //actually compile
@ -2621,7 +2621,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
out_directory_cdin, makefilein + " " + s); out_directory_cdin, makefilein + " " + s);
} }
} }
t << endl; t << Qt::endl;
if (!(flags & SubTargetSkipDefaultTargets)) { if (!(flags & SubTargetSkipDefaultTargets)) {
writeMakeQmake(t, true); writeMakeQmake(t, true);
@ -2670,7 +2670,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
} else if(suffix == "distclean") { } else if(suffix == "distclean") {
QString ofile = fileFixify(Option::output.fileName()); QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty()) if(!ofile.isEmpty())
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n"); t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
} }
} }
@ -2683,7 +2683,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
cmd = var(ProKey(*qut_it + ".commands")), deps; cmd = var(ProKey(*qut_it + ".commands")), deps;
if(targ.isEmpty()) if(targ.isEmpty())
targ = (*qut_it).toQString(); targ = (*qut_it).toQString();
t << endl; t << Qt::endl;
const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends")); const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends"));
for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) { for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
@ -2758,7 +2758,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
deps += " FORCE"; deps += " FORCE";
t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n"; t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n";
if(!cmd.isEmpty()) if(!cmd.isEmpty())
t << "\t" << cmd << endl; t << "\t" << cmd << Qt::endl;
} }
if(flags & SubTargetInstalls) { if(flags & SubTargetInstalls) {
@ -2776,7 +2776,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files)); QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files));
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t" t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
<< "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << endl; << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << Qt::endl;
} }
QString qmake = build_args(); QString qmake = build_args();
@ -2795,10 +2795,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
} }
const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES")); const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES"));
t << included.join(QString(" \\\n\t\t")) << "\n\t" t << included.join(QString(" \\\n\t\t")) << "\n\t"
<< qmake << endl; << qmake << Qt::endl;
const ProStringList &extraCommands = project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS"); const ProStringList &extraCommands = project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS");
if (!extraCommands.isEmpty()) if (!extraCommands.isEmpty())
t << "\t" << extraCommands.join(QString("\n\t")) << endl; t << "\t" << extraCommands.join(QString("\n\t")) << Qt::endl;
for(int include = 0; include < included.size(); ++include) { for(int include = 0; include < included.size(); ++include) {
const ProString &i = included.at(include); const ProString &i = included.at(include);
if(!i.isEmpty()) if(!i.isEmpty())
@ -2806,7 +2806,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
} }
} }
if(project->first("QMAKE_ORIG_TARGET") != "qmake") { if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
t << "qmake: FORCE\n\t@" << qmake << endl << endl; t << "qmake: FORCE\n\t@" << qmake << Qt::endl << Qt::endl;
if (!noDummyQmakeAll) if (!noDummyQmakeAll)
t << "qmake_all: FORCE\n\n"; t << "qmake_all: FORCE\n\n";
} }
@ -3298,11 +3298,11 @@ MakefileGenerator::writePkgConfigFile()
if(includeDir.isEmpty()) if(includeDir.isEmpty())
includeDir = prefix + "/include"; includeDir = prefix + "/include";
t << "prefix=" << prefix << endl; t << "prefix=" << prefix << Qt::endl;
t << "exec_prefix=${prefix}\n" t << "exec_prefix=${prefix}\n"
<< "libdir=" << pkgConfigFixPath(libDir) << "\n" << "libdir=" << pkgConfigFixPath(libDir) << "\n"
<< "includedir=" << pkgConfigFixPath(includeDir) << endl; << "includedir=" << pkgConfigFixPath(includeDir) << Qt::endl;
t << endl; t << Qt::endl;
//extra PKGCONFIG variables //extra PKGCONFIG variables
const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES"); const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
@ -3323,17 +3323,17 @@ MakefileGenerator::writePkgConfigFile()
} }
} }
if (!val.isEmpty()) if (!val.isEmpty())
t << var << "=" << val << endl; t << var << "=" << val << Qt::endl;
} }
t << endl; t << Qt::endl;
QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString(); QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString();
if(name.isEmpty()) { if(name.isEmpty()) {
name = project->first("QMAKE_ORIG_TARGET").toQString().toLower(); name = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
name.replace(0, 1, name[0].toUpper()); name.replace(0, 1, name[0].toUpper());
} }
t << "Name: " << name << endl; t << "Name: " << name << Qt::endl;
QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(' '); QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(' ');
if(desc.isEmpty()) { if(desc.isEmpty()) {
if(name.isEmpty()) { if(name.isEmpty()) {
@ -3351,12 +3351,12 @@ MakefileGenerator::writePkgConfigFile()
desc += " Application"; desc += " Application";
} }
} }
t << "Description: " << desc << endl; t << "Description: " << desc << Qt::endl;
ProString version = project->first("QMAKE_PKGCONFIG_VERSION"); ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
if (version.isEmpty()) if (version.isEmpty())
version = project->first("VERSION"); version = project->first("VERSION");
if (!version.isEmpty()) if (!version.isEmpty())
t << "Version: " << version << endl; t << "Version: " << version << Qt::endl;
// libs // libs
t << "Libs: "; t << "Libs: ";
@ -3393,7 +3393,7 @@ MakefileGenerator::writePkgConfigFile()
t << "Libs.private:"; t << "Libs.private:";
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
t << ' ' << fixLibFlags((*it).toKey()).join(' '); t << ' ' << fixLibFlags((*it).toKey()).join(' ');
t << endl; t << Qt::endl;
} }
// flags // flags
@ -3411,15 +3411,15 @@ MakefileGenerator::writePkgConfigFile()
&& libDir != QLatin1String("/Library/Frameworks")) { && libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}"; t << " -F${libdir}";
} }
t << endl; t << Qt::endl;
// requires // requires
const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' '); const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
if (!requires.isEmpty()) { if (!requires.isEmpty()) {
t << "Requires: " << requires << endl; t << "Requires: " << requires << Qt::endl;
} }
t << endl; t << Qt::endl;
} }
static QString windowsifyPath(const QString &str) static QString windowsifyPath(const QString &str)

View File

@ -324,14 +324,14 @@ ProjectGenerator::init()
bool bool
ProjectGenerator::writeMakefile(QTextStream &t) ProjectGenerator::writeMakefile(QTextStream &t)
{ {
t << "######################################################################" << endl; t << "######################################################################" << Qt::endl;
t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << endl; t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << Qt::endl;
t << "######################################################################" << endl << endl; t << "######################################################################" << Qt::endl << Qt::endl;
if (!Option::globals->extra_cmds[QMakeEvalBefore].isEmpty()) if (!Option::globals->extra_cmds[QMakeEvalBefore].isEmpty())
t << Option::globals->extra_cmds[QMakeEvalBefore] << endl; t << Option::globals->extra_cmds[QMakeEvalBefore] << Qt::endl;
t << getWritableVar("TEMPLATE_ASSIGN", false); t << getWritableVar("TEMPLATE_ASSIGN", false);
if(project->first("TEMPLATE_ASSIGN") == "subdirs") { if(project->first("TEMPLATE_ASSIGN") == "subdirs") {
t << endl << "# Directories" << "\n" t << Qt::endl << "# Directories" << "\n"
<< getWritableVar("SUBDIRS"); << getWritableVar("SUBDIRS");
} else { } else {
//figure out target //figure out target
@ -343,7 +343,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
t << getWritableVar("TARGET_ASSIGN") t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false) << getWritableVar("CONFIG", false)
<< getWritableVar("CONFIG_REMOVE", false) << getWritableVar("CONFIG_REMOVE", false)
<< getWritableVar("INCLUDEPATH") << endl; << getWritableVar("INCLUDEPATH") << Qt::endl;
t << "# You can make your code fail to compile if you use deprecated APIs.\n" t << "# You can make your code fail to compile if you use deprecated APIs.\n"
"# In order to do so, uncomment the following line.\n" "# In order to do so, uncomment the following line.\n"
@ -362,7 +362,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
<< getWritableVar("TRANSLATIONS"); << getWritableVar("TRANSLATIONS");
} }
if (!Option::globals->extra_cmds[QMakeEvalAfter].isEmpty()) if (!Option::globals->extra_cmds[QMakeEvalAfter].isEmpty())
t << Option::globals->extra_cmds[QMakeEvalAfter] << endl; t << Option::globals->extra_cmds[QMakeEvalAfter] << Qt::endl;
return true; return true;
} }

View File

@ -83,8 +83,8 @@ void
UnixMakefileGenerator::writeDefaultVariables(QTextStream &t) UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
{ {
MakefileGenerator::writeDefaultVariables(t); MakefileGenerator::writeDefaultVariables(t);
t << "TAR = " << var("QMAKE_TAR") << endl; t << "TAR = " << var("QMAKE_TAR") << Qt::endl;
t << "COMPRESS = " << var("QMAKE_GZIP") << endl; t << "COMPRESS = " << var("QMAKE_GZIP") << Qt::endl;
if (project->isEmpty("QMAKE_DISTNAME")) { if (project->isEmpty("QMAKE_DISTNAME")) {
ProString distname = project->first("QMAKE_ORIG_TARGET"); ProString distname = project->first("QMAKE_ORIG_TARGET");
@ -92,13 +92,13 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
distname += project->first("VERSION"); distname += project->first("VERSION");
project->values("QMAKE_DISTNAME") = distname; project->values("QMAKE_DISTNAME") = distname;
} }
t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl; t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << Qt::endl;
if (project->isEmpty("QMAKE_DISTDIR")) if (project->isEmpty("QMAKE_DISTDIR"))
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME"); project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
t << "DISTDIR = " << escapeFilePath(fileFixify( t << "DISTDIR = " << escapeFilePath(fileFixify(
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"), (project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
FileFixifyFromOutdir | FileFixifyAbsolute)) << endl; FileFixifyFromOutdir | FileFixifyAbsolute)) << Qt::endl;
} }
void void
@ -106,10 +106,10 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
{ {
MakefileGenerator::writeSubTargets(t, targets, flags); MakefileGenerator::writeSubTargets(t, targets, flags);
t << "dist: distdir FORCE" << endl; t << "dist: distdir FORCE" << Qt::endl;
t << "\t(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)" t << "\t(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)"; " && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)";
t << endl << endl; t << Qt::endl << Qt::endl;
t << "distdir:"; t << "distdir:";
for (int target = 0; target < targets.size(); ++target) { for (int target = 0; target < targets.size(); ++target) {
@ -118,7 +118,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
} }
t << " FORCE\n\t" t << " FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t" << mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
<< "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl; << "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << Qt::endl << Qt::endl;
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString(); const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
for (int target = 0; target < targets.size(); ++target) { for (int target = 0; target < targets.size(); ++target) {
@ -151,7 +151,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
t << subtarget->target << "-distdir: FORCE"; t << subtarget->target << "-distdir: FORCE";
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out), writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
out_directory_cdin, makefilein); out_directory_cdin, makefilein);
t << endl; t << Qt::endl;
} }
} }
@ -183,11 +183,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
writeExportedVariables(t); writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n"; t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl; t << "CC = " << var("QMAKE_CC") << Qt::endl;
t << "CXX = " << var("QMAKE_CXX") << endl; t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = " t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl; << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n"; t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n"; t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH ="; t << "INCPATH =";
@ -208,38 +208,38 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS")) if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
t << " " << var("QMAKE_FRAMEWORKPATH_FLAGS"); t << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
t << endl; t << Qt::endl;
writeDefaultVariables(t); writeDefaultVariables(t);
if(!project->isActiveConfig("staticlib")) { if(!project->isActiveConfig("staticlib")) {
t << "LINK = " << var("QMAKE_LINK") << endl; t << "LINK = " << var("QMAKE_LINK") << Qt::endl;
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = $(SUBLIBS) " << fixLibFlags("LIBS").join(' ') << ' ' t << "LIBS = $(SUBLIBS) " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' ' << fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' ' << fixLibFlags("QMAKE_LIBS").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
} }
t << "AR = " << var("QMAKE_AR") << endl; t << "AR = " << var("QMAKE_AR") << Qt::endl;
t << "RANLIB = " << var("QMAKE_RANLIB") << endl; t << "RANLIB = " << var("QMAKE_RANLIB") << Qt::endl;
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl; t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
t << "STRIP = " << var("QMAKE_STRIP") << endl; t << "STRIP = " << var("QMAKE_STRIP") << Qt::endl;
t << endl; t << Qt::endl;
t << "####### Output directory\n\n"; t << "####### Output directory\n\n";
// This is used in commands by some .prf files. // This is used in commands by some .prf files.
if (! project->values("OBJECTS_DIR").isEmpty()) if (! project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl; t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << Qt::endl;
else else
t << "OBJECTS_DIR = ./\n"; t << "OBJECTS_DIR = ./\n";
t << endl; t << Qt::endl;
/* files */ /* files */
t << "####### Files\n\n"; t << "####### Files\n\n";
// This is used by the dist target. // This is used by the dist target.
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl; t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
if(do_incremental) { if(do_incremental) {
const ProStringList &objs = project->values("OBJECTS"); const ProStringList &objs = project->values("OBJECTS");
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL"); const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
@ -259,59 +259,59 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\\\n\t\t" << (*objit); t << "\\\n\t\t" << (*objit);
} }
if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done! if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl; t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} else if(!incrs_out.count()) { } else if(!incrs_out.count()) {
t << endl; t << Qt::endl;
} else { } else {
src_incremental = true; src_incremental = true;
t << endl; t << Qt::endl;
t << "INCREMENTAL_OBJECTS = " t << "INCREMENTAL_OBJECTS = "
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl; << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} }
} else { } else {
// Used all over the place in both deps and commands. // Used all over the place in both deps and commands.
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl; t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
} }
if(do_incremental && !src_incremental) if(do_incremental && !src_incremental)
do_incremental = false; do_incremental = false;
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " " t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl;
QString destd = fileVar("DESTDIR"); QString destd = fileVar("DESTDIR");
// When building on non-MSys MinGW, the path ends with a backslash, which // When building on non-MSys MinGW, the path ends with a backslash, which
// GNU make will interpret that as a line continuation. Doubling the backslash // GNU make will interpret that as a line continuation. Doubling the backslash
// avoids the problem, at the cost of the variable containing *both* backslashes. // avoids the problem, at the cost of the variable containing *both* backslashes.
if (destd.endsWith('\\')) if (destd.endsWith('\\'))
destd += '\\'; destd += '\\';
t << "DESTDIR = " << destd << endl; t << "DESTDIR = " << destd << Qt::endl;
t << "TARGET = " << fileVar("TARGET") << endl; t << "TARGET = " << fileVar("TARGET") << Qt::endl;
if(project->isActiveConfig("plugin")) { if(project->isActiveConfig("plugin")) {
t << "TARGETD = " << fileVar("TARGET") << endl; t << "TARGETD = " << fileVar("TARGET") << Qt::endl;
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) { } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
t << "TARGETA = " << fileVar("TARGETA") << endl; t << "TARGETA = " << fileVar("TARGETA") << Qt::endl;
if(!project->isEmpty("QMAKE_BUNDLE")) { if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "TARGETD = " << fileVar("TARGET_x.y") << endl; t << "TARGETD = " << fileVar("TARGET_x.y") << Qt::endl;
t << "TARGET0 = " << fileVar("TARGET_") << endl; t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
} else if (!project->isActiveConfig("unversioned_libname")) { } else if (!project->isActiveConfig("unversioned_libname")) {
t << "TARGET0 = " << fileVar("TARGET_") << endl; t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
if (project->isEmpty("QMAKE_HPUX_SHLIB")) { if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl; t << "TARGETD = " << fileVar("TARGET_x.y.z") << Qt::endl;
t << "TARGET1 = " << fileVar("TARGET_x") << endl; t << "TARGET1 = " << fileVar("TARGET_x") << Qt::endl;
t << "TARGET2 = " << fileVar("TARGET_x.y") << endl; t << "TARGET2 = " << fileVar("TARGET_x.y") << Qt::endl;
} else { } else {
t << "TARGETD = " << fileVar("TARGET_x") << endl; t << "TARGETD = " << fileVar("TARGET_x") << Qt::endl;
} }
} }
} }
writeExtraCompilerVariables(t); writeExtraCompilerVariables(t);
writeExtraVariables(t); writeExtraVariables(t);
t << endl; t << Qt::endl;
// blasted includes // blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES"); const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
ProStringList::ConstIterator it; ProStringList::ConstIterator it;
for(it = qeui.begin(); it != qeui.end(); ++it) for(it = qeui.begin(); it != qeui.end(); ++it)
t << "include " << escapeDependencyPath(*it) << endl; t << "include " << escapeDependencyPath(*it) << Qt::endl;
/* rules */ /* rules */
t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n"; t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n";
@ -321,7 +321,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProStringList objects = project->values("OBJECTS"); ProStringList objects = project->values("OBJECTS");
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) { for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d"); QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
t << "-include " << escapeDependencyPath(d_file) << endl; t << "-include " << escapeDependencyPath(d_file) << Qt::endl;
project->values("QMAKE_DISTCLEAN") << d_file; project->values("QMAKE_DISTCLEAN") << d_file;
} }
} else { } else {
@ -379,8 +379,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp( QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)")); "((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
if(!deps.isEmpty()) if(!deps.isEmpty())
t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << endl; t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << Qt::endl;
t << "-include " << d_file_d << endl; t << "-include " << d_file_d << Qt::endl;
project->values("QMAKE_DISTCLEAN") += d_file; project->values("QMAKE_DISTCLEAN") += d_file;
} }
} }
@ -399,7 +399,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.' t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ' '; + project->first("QMAKE_EXTENSION_STATICLIB")) << ' ';
t << endl << endl; t << Qt::endl << Qt::endl;
} }
QString target_deps; QString target_deps;
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl")) if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
@ -504,7 +504,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)"; t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl; t << Qt::endl << Qt::endl;
} else { } else {
t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) "
<< target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t"; << target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t";
@ -517,7 +517,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty("QMAKE_POST_LINK")) if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
} }
t << endl << endl; t << Qt::endl << Qt::endl;
} }
allDeps = ' ' + depVar("TARGET"); allDeps = ' ' + depVar("TARGET");
} else if(!project->isActiveConfig("staticlib")) { } else if(!project->isActiveConfig("staticlib")) {
@ -548,7 +548,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//actual target //actual target
const QString link_deps = "$(OBJECTS) "; const QString link_deps = "$(OBJECTS) ";
t << incr_target_dir_d << ": " << link_deps << "\n\t" t << incr_target_dir_d << ": " << link_deps << "\n\t"
<< "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl; << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << Qt::endl;
//communicated below //communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD"); ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick
@ -606,7 +606,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET) " << destdir << "$(TARGET)"; << "-$(MOVE) $(TARGET) " << destdir << "$(TARGET)";
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl; t << Qt::endl << Qt::endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) { } else if(!project->isEmpty("QMAKE_BUNDLE")) {
bundledFiles << destdir_r + var("TARGET"); bundledFiles << destdir_r + var("TARGET");
t << "\n\t" t << "\n\t"
@ -620,7 +620,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"; " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl; t << Qt::endl << Qt::endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t"; t << "\n\t";
@ -654,7 +654,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl; t << Qt::endl << Qt::endl;
} else { } else {
t << "\n\t" t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
@ -668,9 +668,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET0) " << destdir << "$(TARGET0)\n\t"; << "-$(MOVE) $(TARGET0) " << destdir << "$(TARGET0)\n\t";
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl; t << Qt::endl << Qt::endl;
} }
t << endl << endl; t << Qt::endl << Qt::endl;
if (! project->isActiveConfig("plugin")) { if (! project->isActiveConfig("plugin")) {
t << "staticlib: " << depVar("TARGETA") << "\n\n"; t << "staticlib: " << depVar("TARGETA") << "\n\n";
@ -688,7 +688,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
if(!project->isEmpty("QMAKE_RANLIB")) if(!project->isEmpty("QMAKE_RANLIB"))
t << "\n\t$(RANLIB) $(TARGETA)"; t << "\n\t$(RANLIB) $(TARGETA)";
t << endl << endl; t << Qt::endl << Qt::endl;
} }
} else { } else {
QString destdir_r = project->first("DESTDIR").toQString(); QString destdir_r = project->first("DESTDIR").toQString();
@ -708,7 +708,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t" << var("QMAKE_POST_LINK") << "\n"; t << "\t" << var("QMAKE_POST_LINK") << "\n";
if (!project->isEmpty("QMAKE_RANLIB")) if (!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n"; t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
t << endl << endl; t << Qt::endl << Qt::endl;
} }
writeMakeQmake(t); writeMakeQmake(t);
@ -722,7 +722,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(!meta_files.isEmpty()) if(!meta_files.isEmpty())
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t" t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
<< "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << endl; << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << Qt::endl;
} }
if (!project->isEmpty("QMAKE_BUNDLE")) { if (!project->isEmpty("QMAKE_BUNDLE")) {
@ -743,7 +743,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@echo \"APPL" << "@echo \"APPL"
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
<< "\" > " << pkginfo_f << endl; << "\" > " << pkginfo_f << Qt::endl;
} }
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE"); ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE");
@ -852,7 +852,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" " << "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" " << "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" " << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl; << "" << info_plist << " >" << info_plist_out << Qt::endl;
//copy the icon //copy the icon
if (!project->isEmpty("ICON")) { if (!project->isEmpty("ICON")) {
QString dir = bundle_dir + "Contents/Resources/"; QString dir = bundle_dir + "Contents/Resources/";
@ -863,7 +863,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t" t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t"
<< mkdir_p_asstring(dir) << "\n\t" << mkdir_p_asstring(dir) << "\n\t"
<< "@$(DEL_FILE) " << icon_path_f << "\n\t" << "@$(DEL_FILE) " << icon_path_f << "\n\t"
<< "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl; << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << Qt::endl;
} }
} else { } else {
ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME"); ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME");
@ -880,7 +880,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" " << "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@," << typeInfo << ",g\" " << "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" " << "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl; << "" << info_plist << " >" << info_plist_out << Qt::endl;
} }
break; break;
} // project->isActiveConfig("no_plist") } // project->isActiveConfig("no_plist")
@ -924,10 +924,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QFileInfo fi(fileInfo(fn)); QFileInfo fi(fileInfo(fn));
if(fi.isDir()) if(fi.isDir())
t << "@$(DEL_FILE) -r " << dst << "\n\t" t << "@$(DEL_FILE) -r " << dst << "\n\t"
<< "@$(COPY_DIR) " << src << " " << dst << endl; << "@$(COPY_DIR) " << src << " " << dst << Qt::endl;
else else
t << "@$(DEL_FILE) " << dst << "\n\t" t << "@$(DEL_FILE) " << dst << "\n\t"
<< "@$(COPY_FILE) " << src << " " << dst << endl; << "@$(COPY_FILE) " << src << " " << dst << Qt::endl;
} }
} }
} }
@ -940,7 +940,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
alldeps << symIt.key(); alldeps << symIt.key();
t << escapeDependencyPath(symIt.key()) << ":\n\t" t << escapeDependencyPath(symIt.key()) << ":\n\t"
<< mkdir_p_asstring(bundle_dir) << "\n\t" << mkdir_p_asstring(bundle_dir) << "\n\t"
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl; << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << Qt::endl;
} }
if (!project->isActiveConfig("shallow_bundle")) { if (!project->isActiveConfig("shallow_bundle")) {
@ -952,24 +952,24 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< mkdir_p_asstring(bundle_dir + "Versions") << "\n\t" << mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
<< "@-$(DEL_FILE) " << currentLink_f << "\n\t" << "@-$(DEL_FILE) " << currentLink_f << "\n\t"
<< "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION") << "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
<< ' ' << currentLink_f << endl; << ' ' << currentLink_f << Qt::endl;
} }
} }
} }
t << endl << "all: " << deps t << Qt::endl << "all: " << deps
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "") << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
<< allDeps << endl << endl; << allDeps << Qt::endl << Qt::endl;
t << "dist: distdir FORCE\n\t"; t << "dist: distdir FORCE\n\t";
t << "(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)" t << "(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`" << Option::dir_sep << "$(DISTNAME).tar.gz ." " && $(MOVE) `dirname $(DISTDIR)`" << Option::dir_sep << "$(DISTNAME).tar.gz ."
" && $(DEL_FILE) -r $(DISTDIR)"; " && $(DEL_FILE) -r $(DISTDIR)";
t << endl << endl; t << Qt::endl << Qt::endl;
t << "distdir: FORCE\n\t" t << "distdir: FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t" << mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
<< "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << endl; << "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << Qt::endl;
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
@ -979,20 +979,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(val.isEmpty()) if(val.isEmpty())
continue; continue;
t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ') t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ')
<< " $(DISTDIR)" << Option::dir_sep << endl; << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
} }
} }
} }
if(!project->isEmpty("TRANSLATIONS")) if(!project->isEmpty("TRANSLATIONS"))
t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl; t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
t << endl << endl; t << Qt::endl << Qt::endl;
QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS"); QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS");
if(do_incremental) { if(do_incremental) {
t << "incrclean:\n"; t << "incrclean:\n";
if(src_incremental) if(src_incremental)
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n"; t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
t << endl; t << Qt::endl;
} }
t << "clean:" << clean_targets << "\n\t"; t << "clean:" << clean_targets << "\n\t";
@ -1060,7 +1060,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t"; t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t") t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
<< "-$(DEL_FILE) *~ core *.core\n" << "-$(DEL_FILE) *~ core *.core\n"
<< fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl; << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << Qt::endl << Qt::endl;
ProString destdir = project->first("DESTDIR"); ProString destdir = project->first("DESTDIR");
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep)) if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
@ -1068,7 +1068,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n'; t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n';
if(!project->isEmpty("QMAKE_BUNDLE")) { if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE")); QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
t << "\t-$(DEL_FILE) -r " << bundlePath << endl; t << "\t-$(DEL_FILE) -r " << bundlePath << Qt::endl;
} else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) { } else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n"; t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
} else if (project->values("QMAKE_APP_FLAG").isEmpty()) { } else if (project->values("QMAKE_APP_FLAG").isEmpty()) {
@ -1087,9 +1087,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
{ {
QString ofile = fileFixify(Option::output.fileName()); QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty()) if(!ofile.isEmpty())
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
} }
t << endl << endl; t << Qt::endl << Qt::endl;
t << "####### Sub-libraries\n\n"; t << "####### Sub-libraries\n\n";
if (!project->values("SUBLIBS").isEmpty()) { if (!project->values("SUBLIBS").isEmpty()) {
@ -1100,7 +1100,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (it = l.begin(); it != l.end(); ++it) for (it = l.begin(); it != l.end(); ++it)
t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.' t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t" + project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t"
<< var(ProKey("MAKELIB" + *it)) << endl << endl; << var(ProKey("MAKELIB" + *it)) << Qt::endl << Qt::endl;
} }
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) { if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
@ -1184,7 +1184,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
compilerExecutable = "$(CXX)"; compilerExecutable = "$(CXX)";
// compile command // compile command
t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << endl << endl; t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << Qt::endl << Qt::endl;
} }
} }
} }

View File

@ -99,7 +99,7 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
writePkgConfigFile(); writePkgConfigFile();
if(Option::mkfile::do_stub_makefile) { if(Option::mkfile::do_stub_makefile) {
t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << escapeDependencyPath(*it) << ' '; t << escapeDependencyPath(*it) << ' ';
@ -148,7 +148,7 @@ void createLdResponseFile(const QString &fileName, const ProStringList &objList)
.replace(QLatin1Char('\t'), QLatin1String("\\\t")) .replace(QLatin1Char('\t'), QLatin1String("\\\t"))
.replace(QLatin1Char('"'), QLatin1String("\\\"")) .replace(QLatin1Char('"'), QLatin1String("\\\""))
.replace(QLatin1Char('\''), QLatin1String("\\'")); .replace(QLatin1Char('\''), QLatin1String("\\'"));
t << path << endl; t << path << Qt::endl;
} }
t.flush(); t.flush();
file.close(); file.close();
@ -162,9 +162,9 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file); QTextStream t(&file);
// ### quoting? // ### quoting?
t << "CREATE " << target << endl; t << "CREATE " << target << Qt::endl;
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
t << "ADDMOD " << *it << endl; t << "ADDMOD " << *it << Qt::endl;
} }
t << "SAVE\n"; t << "SAVE\n";
t.flush(); t.flush();
@ -183,13 +183,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut) << "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader) << "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader)
<< ' ' << escapeFilePath(header) << endl << endl; << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++"; QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " " t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut) << "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader) << "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader)
<< ' ' << escapeFilePath(header) << endl << endl; << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
} }
} }
@ -274,21 +274,21 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
t << "-I"; t << "-I";
t << escapeFilePath(inc) << ' '; t << escapeFilePath(inc) << ' ';
} }
t << endl; t << Qt::endl;
} }
void MingwMakefileGenerator::writeLibsPart(QTextStream &t) void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
{ {
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
t << "LIB = " << var("QMAKE_LIB") << endl; t << "LIB = " << var("QMAKE_LIB") << Qt::endl;
} else { } else {
t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = " t << "LIBS = "
<< fixLibFlags("LIBS").join(' ') << ' ' << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' ' << fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' ' << fixLibFlags("QMAKE_LIBS").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
} }
} }
@ -350,7 +350,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
} }
if(!project->isEmpty("QMAKE_POST_LINK")) if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK"); t << "\n\t" <<var("QMAKE_POST_LINK");
t << endl; t << Qt::endl;
} }
void MingwMakefileGenerator::writeRcFilePart(QTextStream &t) void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)

View File

@ -143,7 +143,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' ' t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") << finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP "
<< escapeFilePath(precompH) << endl << endl; << escapeFilePath(precompH) << Qt::endl << Qt::endl;
} }
if (usePCHC) { if (usePCHC) {
QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2") QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2")
@ -151,7 +151,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' ' t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") << finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CC) " + precompRuleC +" $(CFLAGS) $(INCPATH) -TC " << "\n\t$(CC) " + precompRuleC +" $(CFLAGS) $(INCPATH) -TC "
<< escapeFilePath(precompH) << endl << endl; << escapeFilePath(precompH) << Qt::endl << Qt::endl;
} }
} }
@ -314,7 +314,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
t << " " << (*cit); t << " " << (*cit);
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << " " << (*cppit); t << " " << (*cppit);
t << endl << endl; t << Qt::endl << Qt::endl;
bool useInferenceRules = !project->isActiveConfig("no_batch"); bool useInferenceRules = !project->isActiveConfig("no_batch");
QSet<QString> source_directories; QSet<QString> source_directories;
@ -393,9 +393,9 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
} }
} else { } else {
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl; t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << Qt::endl << Qt::endl;
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit) for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl; t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << Qt::endl << Qt::endl;
} }
} }
@ -498,7 +498,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK")) { if(!project->isEmpty("QMAKE_POST_LINK")) {
t << "\n\t" << var("QMAKE_POST_LINK"); t << "\n\t" << var("QMAKE_POST_LINK");
} }
t << endl; t << Qt::endl;
} }
void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &extraFlags, const QString &extraInlineFileContent) void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &extraFlags, const QString &extraInlineFileContent)

View File

@ -923,7 +923,7 @@ struct VCFilterFile
inline QDebug operator<<(QDebug dbg, const VCFilterFile &p) inline QDebug operator<<(QDebug dbg, const VCFilterFile &p)
{ {
dbg.nospace() << "VCFilterFile(file(" << p.file dbg.nospace() << "VCFilterFile(file(" << p.file
<< ") excludeFromBuild(" << p.excludeFromBuild << "))" << endl; << ") excludeFromBuild(" << p.excludeFromBuild << "))" << Qt::endl;
return dbg.space(); return dbg.space();
} }
#endif #endif

View File

@ -320,11 +320,11 @@ void Win32MakefileGenerator::processRcFileVar()
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
ts << "#include <windows.h>\n"; ts << "#include <windows.h>\n";
ts << endl; ts << Qt::endl;
if (!rcIcons.isEmpty()) { if (!rcIcons.isEmpty()) {
for (int i = 0; i < rcIcons.size(); ++i) for (int i = 0; i < rcIcons.size(); ++i)
ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl; ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << Qt::endl;
ts << endl; ts << Qt::endl;
} }
if (!manifestFile.isEmpty()) { if (!manifestFile.isEmpty()) {
QString manifestResourceId; QString manifestResourceId;
@ -335,8 +335,8 @@ void Win32MakefileGenerator::processRcFileVar()
ts << manifestResourceId << " RT_MANIFEST \"" << manifestFile << "\"\n"; ts << manifestResourceId << " RT_MANIFEST \"" << manifestFile << "\"\n";
} }
ts << "VS_VERSION_INFO VERSIONINFO\n"; ts << "VS_VERSION_INFO VERSIONINFO\n";
ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl; ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl; ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
ts << "\tFILEFLAGSMASK 0x3fL\n"; ts << "\tFILEFLAGSMASK 0x3fL\n";
ts << "#ifdef _DEBUG\n"; ts << "#ifdef _DEBUG\n";
ts << "\tFILEFLAGS VS_FF_DEBUG\n"; ts << "\tFILEFLAGS VS_FF_DEBUG\n";
@ -369,11 +369,11 @@ void Win32MakefileGenerator::processRcFileVar()
ts << "\t\tBEGIN\n"; ts << "\t\tBEGIN\n";
ts << "\t\t\tVALUE \"Translation\", " ts << "\t\t\tVALUE \"Translation\", "
<< QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0')) << QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0'))
<< ", " << QString("%1").arg(rcCodePage, 4) << endl; << ", " << QString("%1").arg(rcCodePage, 4) << Qt::endl;
ts << "\t\tEND\n"; ts << "\t\tEND\n";
ts << "\tEND\n"; ts << "\tEND\n";
ts << "/* End of Version info */\n"; ts << "/* End of Version info */\n";
ts << endl; ts << Qt::endl;
ts.flush(); ts.flush();
@ -470,7 +470,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
} }
} }
} }
t << endl << endl; t << Qt::endl << Qt::endl;
t << "distclean: clean " << depVar("DISTCLEAN_DEPS"); t << "distclean: clean " << depVar("DISTCLEAN_DEPS");
{ {
@ -503,9 +503,9 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
{ {
QString ofile = fileFixify(Option::output.fileName()); QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty()) if(!ofile.isEmpty())
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
} }
t << endl; t << Qt::endl;
} }
void Win32MakefileGenerator::writeIncPart(QTextStream &t) void Win32MakefileGenerator::writeIncPart(QTextStream &t)
@ -519,7 +519,7 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
if(!inc.isEmpty()) if(!inc.isEmpty())
t << "-I" << escapeFilePath(inc) << ' '; t << "-I" << escapeFilePath(inc) << ' ';
} }
t << endl; t << Qt::endl;
} }
void Win32MakefileGenerator::writeStandardParts(QTextStream &t) void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
@ -527,51 +527,51 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExportedVariables(t); writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n"; t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl; t << "CC = " << var("QMAKE_CC") << Qt::endl;
t << "CXX = " << var("QMAKE_CXX") << endl; t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = " t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl; << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n"; t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n"; t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
writeIncPart(t); writeIncPart(t);
writeLibsPart(t); writeLibsPart(t);
t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC")) t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
<< endl; << Qt::endl;
t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL")) t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
<< endl; << Qt::endl;
t << "ZIP = " << var("QMAKE_ZIP") << endl; t << "ZIP = " << var("QMAKE_ZIP") << Qt::endl;
t << "DEF_FILE = " << fileVar("DEF_FILE") << endl; t << "DEF_FILE = " << fileVar("DEF_FILE") << Qt::endl;
t << "RES_FILE = " << fileVar("RES_FILE") << endl; // Not on mingw, can't see why not though... t << "RES_FILE = " << fileVar("RES_FILE") << Qt::endl; // Not on mingw, can't see why not though...
t << "COPY = " << var("QMAKE_COPY") << endl; t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl; t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl; t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl; t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
t << "MOVE = " << var("QMAKE_MOVE") << endl; t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
t << "MKDIR = " << var("QMAKE_MKDIR") << endl; t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl; t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl; t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl; t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl; t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl; t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
t << endl; t << Qt::endl;
t << "####### Output directory\n\n"; t << "####### Output directory\n\n";
if(!project->values("OBJECTS_DIR").isEmpty()) if(!project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << endl; t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << Qt::endl;
else else
t << "OBJECTS_DIR = . \n"; t << "OBJECTS_DIR = . \n";
t << endl; t << Qt::endl;
t << "####### Files\n\n"; t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES")))
<< " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl; << " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << Qt::endl;
// do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed. // do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed.
QString orgDestDir = var("DESTDIR"); QString orgDestDir = var("DESTDIR");
@ -587,14 +587,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExtraVariables(t); writeExtraVariables(t);
t << "DIST = " << fileVarList("DISTFILES") << ' ' t << "DIST = " << fileVarList("DISTFILES") << ' '
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // unused t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl; // unused
// The comment is important to maintain variable compatibility with Unix // The comment is important to maintain variable compatibility with Unix
// Makefiles, while not interpreting a trailing-slash as a linebreak // Makefiles, while not interpreting a trailing-slash as a linebreak
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n"; t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
t << "TARGET = " << escapeFilePath(target) << endl; t << "TARGET = " << escapeFilePath(target) << Qt::endl;
t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl; t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << Qt::endl;
t << endl; t << Qt::endl;
writeImplicitRulesPart(t); writeImplicitRulesPart(t);
@ -606,10 +606,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &dlldirs = project->values("DLLDESTDIR"); const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) { for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) " t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl; << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << Qt::endl;
} }
} }
t << endl; t << Qt::endl;
writeRcFilePart(t); writeRcFilePart(t);
} }
@ -642,33 +642,33 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
} }
} }
} }
t << endl << endl; t << Qt::endl << Qt::endl;
writeCleanParts(t); writeCleanParts(t);
writeExtraTargets(t); writeExtraTargets(t);
writeExtraCompilerTargets(t); writeExtraCompilerTargets(t);
t << endl << endl; t << Qt::endl << Qt::endl;
} }
void Win32MakefileGenerator::writeLibsPart(QTextStream &t) void Win32MakefileGenerator::writeLibsPart(QTextStream &t)
{ {
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
t << "LIBAPP = " << var("QMAKE_LIB") << endl; t << "LIBAPP = " << var("QMAKE_LIB") << Qt::endl;
t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << endl; t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << Qt::endl;
} else { } else {
t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = " << fixLibFlags("LIBS").join(' ') << ' ' t << "LIBS = " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' ' << fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' ' << fixLibFlags("QMAKE_LIBS").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
} }
} }
void Win32MakefileGenerator::writeObjectsPart(QTextStream &t) void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
{ {
// Used in both deps and commands. // Used in both deps and commands.
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl; t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
} }
void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t) void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t)
@ -710,7 +710,7 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
<< defines << incPathStr << " -fo " << escapeFilePath(res_file) << defines << incPathStr << " -fo " << escapeFilePath(res_file)
<< ' ' << escapeFilePath(rc_file); << ' ' << escapeFilePath(rc_file);
t << endl << endl; t << Qt::endl << Qt::endl;
} }
} }

View File

@ -237,7 +237,7 @@ void XmlOutput::newTagOpen(const QString &tag)
closeOpen(); closeOpen();
if (format == NewLine) if (format == NewLine)
xmlFile << endl << currentIndent; xmlFile << Qt::endl << currentIndent;
xmlFile << '<' << doConversion(tag); xmlFile << '<' << doConversion(tag);
currentState = Attribute; currentState = Attribute;
tagStack.append(tag); tagStack.append(tag);
@ -271,7 +271,7 @@ void XmlOutput::closeTag()
case Tag: case Tag:
decreaseIndent(); // <--- Pre-decrease indent decreaseIndent(); // <--- Pre-decrease indent
if (format == NewLine) if (format == NewLine)
xmlFile << endl << currentIndent; xmlFile << Qt::endl << currentIndent;
xmlFile << "</" << doConversion(tagStack.last()) << '>'; xmlFile << "</" << doConversion(tagStack.last()) << '>';
tagStack.pop_back(); tagStack.pop_back();
break; break;
@ -343,7 +343,7 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value)
break; break;
} }
if (format == NewLine) if (format == NewLine)
xmlFile << endl; xmlFile << Qt::endl;
xmlFile << currentIndent << doConversion(attribute) << "=\"" << doConversion(value) << "\""; xmlFile << currentIndent << doConversion(attribute) << "=\"" << doConversion(value) << "\"";
} }

View File

@ -1471,7 +1471,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
while (finalOrder[toMove].form && fixed < len-1) { 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); 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++) { 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]; // << "position=" << position[i];
if (form(uc[i]) == finalOrder[toMove].form && if (form(uc[i]) == finalOrder[toMove].form &&
position[i] == finalOrder[toMove].position) { position[i] == finalOrder[toMove].position) {

View File

@ -370,7 +370,7 @@ void tst_QScriptEngine::greek()
QString str; QString str;
str.append(uc); str.append(uc);
if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
//qDebug() << "skipping" << hex << uc; //qDebug() << "skipping" << Qt::hex << uc;
continue; continue;
} }
if (uc == 0x1fc1 || uc == 0x1fed) if (uc == 0x1fc1 || uc == 0x1fed)
@ -389,7 +389,7 @@ void tst_QScriptEngine::greek()
QString str; QString str;
str.append(uc); str.append(uc);
if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) { if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
//qDebug() << "skipping" << hex << uc; //qDebug() << "skipping" << Qt::hex << uc;
continue; continue;
} }
if (uc == 0x1fc1 || uc == 0x1fed) if (uc == 0x1fc1 || uc == 0x1fed)

View File

@ -133,7 +133,7 @@ QSet<QString> set;
... ...
QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette"); QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
if (it != set.end()) if (it != set.end())
cout << "Found Jeanette" << endl; cout << "Found Jeanette" << Qt::endl;
//! [10] //! [10]
@ -152,7 +152,7 @@ QSet<QString> set;
... ...
QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette"); QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
if (it != set.constEnd()) if (it != set.constEnd())
cout << "Found Jeanette" << endl; cout << "Found Jeanette" << Qt::endl;
//! [12] //! [12]

View File

@ -124,12 +124,12 @@ in >> ch1 >> ch2 >> ch3;
//! [8] //! [8]
QTextStream out(stdout); QTextStream out(stdout);
out << "Qt rocks!" << endl; out << "Qt rocks!" << Qt::endl;
//! [8] //! [8]
//! [9] //! [9]
stream << '\n' << flush; stream << '\n' << Qt::flush;
//! [9] //! [9]

View File

@ -53,7 +53,7 @@ QFuture<QString> future = ...;
QFuture<QString>::const_iterator i; QFuture<QString>::const_iterator i;
for (i = future.constBegin(); i != future.constEnd(); ++i) for (i = future.constBegin(); i != future.constEnd(); ++i)
cout << *i << endl; cout << *i << Qt::endl;
//! [0] //! [0]

View File

@ -71,7 +71,7 @@ ba[4] = 0xca;
//! [2] //! [2]
for (int i = 0; i < ba.size(); ++i) { for (int i = 0; i < ba.size(); ++i) {
if (ba.at(i) >= 'a' && ba.at(i) <= 'f') 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] //! [2]
@ -88,7 +88,7 @@ x.replace(5, 3, "&"); // x == "rock & roll"
QByteArray ba("We must be <b>bold</b>, very <b>bold</b>"); QByteArray ba("We must be <b>bold</b>, very <b>bold</b>");
int j = 0; int j = 0;
while ((j = ba.indexOf("<b>", j)) != -1) { while ((j = ba.indexOf("<b>", j)) != -1) {
cout << "Found <b> tag at index position " << j << endl; cout << "Found <b> tag at index position " << j << Qt::endl;
++j; ++j;
} }
//! [4] //! [4]
@ -126,7 +126,7 @@ QByteArray("abc").isEmpty(); // returns false
QByteArray ba("Hello world"); QByteArray ba("Hello world");
char *data = ba.data(); char *data = ba.data();
while (*data) { while (*data) {
cout << "[" << *data << "]" << endl; cout << "[" << *data << "]" << Qt::endl;
++data; ++data;
} }
//! [8] //! [8]

View File

@ -89,7 +89,7 @@ QHash<int, QWidget *> hash;
... ...
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 1000; ++i) {
if (hash[i] == okButton) if (hash[i] == okButton)
cout << "Found button at index " << i << endl; cout << "Found button at index " << i << Qt::endl;
} }
//! [6] //! [6]
@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) {
QHashIterator<QString, int> i(hash); QHashIterator<QString, int> i(hash);
while (i.hasNext()) { while (i.hasNext()) {
i.next(); i.next();
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
} }
//! [7] //! [7]
@ -106,7 +106,7 @@ while (i.hasNext()) {
//! [8] //! [8]
QHash<QString, int>::const_iterator i = hash.constBegin(); QHash<QString, int>::const_iterator i = hash.constBegin();
while (i != hash.constEnd()) { while (i != hash.constEnd()) {
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
++i; ++i;
} }
//! [8] //! [8]
@ -122,14 +122,14 @@ hash.insert("plenty", 2000);
//! [10] //! [10]
QList<int> values = hash.values("plenty"); QList<int> values = hash.values("plenty");
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)
cout << values.at(i) << endl; cout << values.at(i) << Qt::endl;
//! [10] //! [10]
//! [11] //! [11]
QHash<QString, int>::iterator i = hash.find("plenty"); QHash<QString, int>::iterator i = hash.find("plenty");
while (i != hash.end() && i.key() == "plenty") { while (i != hash.end() && i.key() == "plenty") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [11] //! [11]
@ -139,7 +139,7 @@ while (i != hash.end() && i.key() == "plenty") {
QHash<QString, int> hash; QHash<QString, int> hash;
... ...
foreach (int value, hash) foreach (int value, hash)
cout << value << endl; cout << value << Qt::endl;
//! [12] //! [12]
@ -201,7 +201,7 @@ QHash<QString, int> hash;
... ...
QHash<QString, int>::const_iterator i = hash.find("HDR"); QHash<QString, int>::const_iterator i = hash.find("HDR");
while (i != hash.end() && i.key() == "HDR") { while (i != hash.end() && i.key() == "HDR") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [16] //! [16]
@ -216,7 +216,7 @@ hash.insert("December", 12);
QHash<QString, int>::iterator i; QHash<QString, int>::iterator i;
for (i = hash.begin(); i != hash.end(); ++i) for (i = hash.begin(); i != hash.end(); ++i)
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
//! [17] //! [17]
@ -274,7 +274,7 @@ hash.insert("December", 12);
QHash<QString, int>::const_iterator i; QHash<QString, int>::const_iterator i;
for (i = hash.constBegin(); i != hash.constEnd(); ++i) for (i = hash.constBegin(); i != hash.constEnd(); ++i)
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
//! [23] //! [23]
@ -296,23 +296,23 @@ hash3 = hash1 + hash2;
//! [25] //! [25]
QList<int> values = hash.values("plenty"); QList<int> values = hash.values("plenty");
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)
cout << values.at(i) << endl; cout << values.at(i) << Qt::endl;
//! [25] //! [25]
//! [26] //! [26]
QMultiHash<QString, int>::iterator i = hash.find("plenty"); QMultiHash<QString, int>::iterator i = hash.find("plenty");
while (i != hash.end() && i.key() == "plenty") { while (i != hash.end() && i.key() == "plenty") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [26] //! [26]
//! [27] //! [27]
for (QHash<int, QString>::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) { for (QHash<int, QString>::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) {
cout << "The key: " << it.key() << endl cout << "The key: " << it.key() << Qt::endl
cout << "The value: " << it.value() << endl; cout << "The value: " << it.value() << Qt::endl;
cout << "Also the value: " << (*it) << endl; cout << "Also the value: " << (*it) << Qt::endl;
} }
//! [27] //! [27]

View File

@ -112,7 +112,7 @@ list.append("December");
QLinkedList<QString>::iterator i; QLinkedList<QString>::iterator i;
for (i = list.begin(); i != list.end(); ++i) for (i = list.begin(); i != list.end(); ++i)
cout << *i << endl; cout << *i << Qt::endl;
//! [7] //! [7]
@ -122,7 +122,7 @@ QLinkedList<QString> list;
QLinkedList<QString>::iterator it = qFind(list.begin(), QLinkedList<QString>::iterator it = qFind(list.begin(),
list.end(), "Joel"); list.end(), "Joel");
if (it != list.end()) if (it != list.end())
cout << "Found Joel" << endl; cout << "Found Joel" << Qt::endl;
//! [8] //! [8]
@ -182,7 +182,7 @@ list.append("December");
QLinkedList<QString>::const_iterator i; QLinkedList<QString>::const_iterator i;
for (i = list.constBegin(); i != list.constEnd(); ++i) for (i = list.constBegin(); i != list.constEnd(); ++i)
cout << *i << endl; cout << *i << Qt::endl;
//! [14] //! [14]
@ -192,7 +192,7 @@ QLinkedList<QString> list;
QLinkedList<QString>::iterator it = qFind(list.constBegin(), QLinkedList<QString>::iterator it = qFind(list.constBegin(),
list.constEnd(), "Joel"); list.constEnd(), "Joel");
if (it != list.constEnd()) if (it != list.constEnd())
cout << "Found Joel" << endl; cout << "Found Joel" << Qt::endl;
//! [15] //! [15]

View File

@ -73,7 +73,7 @@ if (list[0] == "Bob")
//! [3] //! [3]
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
if (list.at(i) == "Jane") if (list.at(i) == "Jane")
cout << "Found Jane at position " << i << endl; cout << "Found Jane at position " << i << Qt::endl;
} }
//! [3] //! [3]
@ -89,7 +89,7 @@ while (!list.isEmpty())
//! [5] //! [5]
int i = list.indexOf("Jane"); int i = list.indexOf("Jane");
if (i != -1) 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] //! [5]
@ -180,7 +180,7 @@ list.append("December");
QList<QString>::iterator i; QList<QString>::iterator i;
for (i = list.begin(); i != list.end(); ++i) for (i = list.begin(); i != list.end(); ++i)
cout << *i << endl; cout << *i << Qt::endl;
//! [15] //! [15]
@ -213,7 +213,7 @@ list.append("December");
QList<QString>::const_iterator i; QList<QString>::const_iterator i;
for (i = list.constBegin(); i != list.constEnd(); ++i) for (i = list.constBegin(); i != list.constEnd(); ++i)
cout << *i << endl; cout << *i << Qt::endl;
//! [19] //! [19]

View File

@ -89,7 +89,7 @@ QMap<int, QWidget *> map;
... ...
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 1000; ++i) {
if (map[i] == okButton) if (map[i] == okButton)
cout << "Found button at index " << i << endl; cout << "Found button at index " << i << Qt::endl;
} }
//! [6] //! [6]
@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) {
QMapIterator<QString, int> i(map); QMapIterator<QString, int> i(map);
while (i.hasNext()) { while (i.hasNext()) {
i.next(); i.next();
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
} }
//! [7] //! [7]
@ -106,7 +106,7 @@ while (i.hasNext()) {
//! [8] //! [8]
QMap<QString, int>::const_iterator i = map.constBegin(); QMap<QString, int>::const_iterator i = map.constBegin();
while (i != map.constEnd()) { while (i != map.constEnd()) {
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
++i; ++i;
} }
//! [8] //! [8]
@ -122,14 +122,14 @@ map.insert("plenty", 2000);
//! [10] //! [10]
QList<int> values = map.values("plenty"); QList<int> values = map.values("plenty");
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)
cout << values.at(i) << endl; cout << values.at(i) << Qt::endl;
//! [10] //! [10]
//! [11] //! [11]
QMap<QString, int>::iterator i = map.find("plenty"); QMap<QString, int>::iterator i = map.find("plenty");
while (i != map.end() && i.key() == "plenty") { while (i != map.end() && i.key() == "plenty") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [11] //! [11]
@ -139,7 +139,7 @@ while (i != map.end() && i.key() == "plenty") {
QMap<QString, int> map; QMap<QString, int> map;
... ...
foreach (int value, map) foreach (int value, map)
cout << value << endl; cout << value << Qt::endl;
//! [12] //! [12]
@ -175,7 +175,7 @@ QMap<QString, int> map;
... ...
QMap<QString, int>::const_iterator i = map.find("HDR"); QMap<QString, int>::const_iterator i = map.find("HDR");
while (i != map.end() && i.key() == "HDR") { while (i != map.end() && i.key() == "HDR") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [14] //! [14]
@ -201,7 +201,7 @@ QMap<QString, int> map;
QMap<QString, int>::const_iterator i = map.lowerBound("HDR"); QMap<QString, int>::const_iterator i = map.lowerBound("HDR");
QMap<QString, int>::const_iterator upperBound = map.upperBound("HDR"); QMap<QString, int>::const_iterator upperBound = map.upperBound("HDR");
while (i != upperBound) { while (i != upperBound) {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [16] //! [16]
@ -230,7 +230,7 @@ map.insert("December", 12);
QMap<QString, int>::iterator i; QMap<QString, int>::iterator i;
for (i = map.begin(); i != map.end(); ++i) for (i = map.begin(); i != map.end(); ++i)
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
//! [18] //! [18]
@ -288,7 +288,7 @@ map.insert("December", 12);
QMap<QString, int>::const_iterator i; QMap<QString, int>::const_iterator i;
for (i = map.constBegin(); i != map.constEnd(); ++i) for (i = map.constBegin(); i != map.constEnd(); ++i)
cout << i.key() << ": " << i.value() << endl; cout << i.key() << ": " << i.value() << Qt::endl;
//! [24] //! [24]
@ -310,23 +310,23 @@ map3 = map1 + map2;
//! [26] //! [26]
QList<int> values = map.values("plenty"); QList<int> values = map.values("plenty");
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)
cout << values.at(i) << endl; cout << values.at(i) << Qt::endl;
//! [26] //! [26]
//! [27] //! [27]
QMultiMap<QString, int>::iterator i = map.find("plenty"); QMultiMap<QString, int>::iterator i = map.find("plenty");
while (i != map.end() && i.key() == "plenty") { while (i != map.end() && i.key() == "plenty") {
cout << i.value() << endl; cout << i.value() << Qt::endl;
++i; ++i;
} }
//! [27] //! [27]
//! [keyiterator1] //! [keyiterator1]
for (QMap<int, QString>::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) { for (QMap<int, QString>::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) {
cout << "The key: " << it.key() << endl cout << "The key: " << it.key() << Qt::endl
cout << "The value: " << it.value() << endl; cout << "The value: " << it.value() << Qt::endl;
cout << "Also the value: " << (*it) << endl; cout << "Also the value: " << (*it) << Qt::endl;
} }
//! [keyiterator1] //! [keyiterator1]

View File

@ -54,5 +54,5 @@ queue.enqueue(1);
queue.enqueue(2); queue.enqueue(2);
queue.enqueue(3); queue.enqueue(3);
while (!queue.isEmpty()) while (!queue.isEmpty())
cout << queue.dequeue() << endl; cout << queue.dequeue() << Qt::endl;
//! [0] //! [0]

View File

@ -72,9 +72,9 @@ while (i.hasNext())
{ {
//! [2] //! [2]
QStringIterator i(u"𝄞 is the G clef"); QStringIterator i(u"𝄞 is the G clef");
qDebug() << hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF) qDebug() << Qt::hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF)
qDebug() << hex << i.next(); // will print 20 (U+0020, SPACE) qDebug() << Qt::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 69 (U+0069, LATIN SMALL LETTER I)
//! [2] //! [2]
} }

View File

@ -73,7 +73,7 @@ if (vector[0] == "Liz")
//! [4] //! [4]
for (int i = 0; i < vector.size(); ++i) { for (int i = 0; i < vector.size(); ++i) {
if (vector.at(i) == "Alfonso") if (vector.at(i) == "Alfonso")
cout << "Found Alfonso at position " << i << endl; cout << "Found Alfonso at position " << i << Qt::endl;
} }
//! [4] //! [4]
@ -81,7 +81,7 @@ for (int i = 0; i < vector.size(); ++i) {
//! [5] //! [5]
int i = vector.indexOf("Harumi"); int i = vector.indexOf("Harumi");
if (i != -1) 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] //! [5]

View File

@ -60,6 +60,6 @@ int main(int argc, char *argv[])
stack.push(2); stack.push(2);
stack.push(3); stack.push(3);
while (!stack.isEmpty()) while (!stack.isEmpty())
cout << stack.pop() << endl; cout << stack.pop() << Qt::endl;
//! [0] //! [0]
} }

View File

@ -71,20 +71,20 @@ Widget::Widget(QWidget *parent)
//! [1] //! [1]
for (int i = 0; i < fonts.size(); ++i) for (int i = 0; i < fonts.size(); ++i)
cout << fonts.at(i).toLocal8Bit().constData() << endl; cout << fonts.at(i).toLocal8Bit().constData() << Qt::endl;
//! [1] //! [1]
//! [2] //! [2]
QStringListIterator javaStyleIterator(fonts); QStringListIterator javaStyleIterator(fonts);
while (javaStyleIterator.hasNext()) while (javaStyleIterator.hasNext())
cout << javaStyleIterator.next().toLocal8Bit().constData() << endl; cout << javaStyleIterator.next().toLocal8Bit().constData() << Qt::endl;
//! [2] //! [2]
//! [3] //! [3]
QStringList::const_iterator constIterator; QStringList::const_iterator constIterator;
for (constIterator = fonts.constBegin(); constIterator != fonts.constEnd(); for (constIterator = fonts.constBegin(); constIterator != fonts.constEnd();
++constIterator) ++constIterator)
cout << (*constIterator).toLocal8Bit().constData() << endl; cout << (*constIterator).toLocal8Bit().constData() << Qt::endl;
//! [3] //! [3]
//! [4] //! [4]

View File

@ -166,7 +166,7 @@ void QDebug::putUcs4(uint ucs4)
{ {
maybeQuote('\''); maybeQuote('\'');
if (ucs4 < 0x20) { if (ucs4 < 0x20) {
stream->ts << "\\x" << hex << ucs4 << reset; stream->ts << "\\x" << Qt::hex << ucs4 << Qt::reset;
} else if (ucs4 < 0x80) { } else if (ucs4 < 0x80) {
stream->ts << char(ucs4); stream->ts << char(ucs4);
} else { } else {
@ -174,7 +174,7 @@ void QDebug::putUcs4(uint ucs4)
stream->ts << "\\u" << qSetFieldWidth(4); stream->ts << "\\u" << qSetFieldWidth(4);
else else
stream->ts << "\\U" << qSetFieldWidth(8); stream->ts << "\\U" << qSetFieldWidth(8);
stream->ts << hex << qSetPadChar(QLatin1Char('0')) << ucs4 << reset; stream->ts << Qt::hex << qSetPadChar(QLatin1Char('0')) << ucs4 << Qt::reset;
} }
maybeQuote('\''); maybeQuote('\'');
} }
@ -834,7 +834,7 @@ QDebug &QDebug::resetFormat()
that QDebugStateSaver stores for the duration of the current block. that QDebugStateSaver stores for the duration of the current block.
The settings of the internal QTextStream are also saved and restored, 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. operators.
\since 5.1 \since 5.1

View File

@ -350,7 +350,7 @@ void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, Int value)
{ {
const QDebugStateSaver saver(debug); const QDebugStateSaver saver(debug);
debug.resetFormat(); debug.resetFormat();
debug.nospace() << "QFlags(" << hex << showbase; debug.nospace() << "QFlags(" << Qt::hex << Qt::showbase;
bool needSeparator = false; bool needSeparator = false;
for (uint i = 0; i < sizeofT * 8; ++i) { for (uint i = 0; i < sizeofT * 8; ++i) {
if (value & (Int(1) << i)) { if (value & (Int(1) << i)) {

View File

@ -388,7 +388,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify()
const inotify_event &event = **it; const inotify_event &event = **it;
++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; int id = event.wd;
QString path = getPathFromID(id); QString path = getPathFromID(id);

View File

@ -79,7 +79,7 @@ static Qt::HANDLE createChangeNotification(const QString &path, uint flags)
nativePath.append(QLatin1Char('\\')); nativePath.append(QLatin1Char('\\'));
const HANDLE result = FindFirstChangeNotification(reinterpret_cast<const wchar_t *>(nativePath.utf16()), const HANDLE result = FindFirstChangeNotification(reinterpret_cast<const wchar_t *>(nativePath.utf16()),
FALSE, flags); FALSE, flags);
DEBUG() << __FUNCTION__ << nativePath << hex <<showbase << flags << "returns" << result; DEBUG() << __FUNCTION__ << nativePath << Qt::hex <<showbase << flags << "returns" << result;
return result; return result;
} }
@ -432,7 +432,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
// Requesting to add a file whose directory has been added previously. // Requesting to add a file whose directory has been added previously.
// Recreate the notification handle to add the missing notification attributes // Recreate the notification handle to add the missing notification attributes
// for files (FILE_NOTIFY_CHANGE_ATTRIBUTES...) // for files (FILE_NOTIFY_CHANGE_ATTRIBUTES...)
DEBUG() << "recreating" << absolutePath << hex << showbase << hit.value().flags DEBUG() << "recreating" << absolutePath << Qt::hex << Qt::showbase << hit.value().flags
<< "->" << flags; << "->" << flags;
const Qt::HANDLE fileHandle = createChangeNotification(absolutePath, flags); const Qt::HANDLE fileHandle = createChangeNotification(absolutePath, flags);
if (fileHandle != INVALID_HANDLE_VALUE) { if (fileHandle != INVALID_HANDLE_VALUE) {

View File

@ -190,7 +190,7 @@ Q_ENUM_PRINTER(Result);
QDebug operator<<(QDebug s, timespec tv) 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; return s;
} }

View File

@ -215,7 +215,7 @@ static timespec roundToMillisecond(timespec val)
QDebug operator<<(QDebug s, timeval tv) QDebug operator<<(QDebug s, timeval tv)
{ {
QDebugStateSaver saver(s); 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; return s;
} }
QDebug operator<<(QDebug s, Qt::TimerType t) QDebug operator<<(QDebug s, Qt::TimerType t)
@ -373,7 +373,7 @@ static void calculateNextTimeout(QTimerInfo *t, timespec currentTime)
#ifdef QTIMERINFO_DEBUG #ifdef QTIMERINFO_DEBUG
if (t->timerType != Qt::PreciseTimer) 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 << "originally expected at" << t->expected << "will fire at" << t->timeout
<< "or" << (t->timeout - t->expected) << "s late"; << "or" << (t->timeout - t->expected) << "s late";
#endif #endif
@ -500,7 +500,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, Qt::TimerType time
t->cumulativeError = 0; t->cumulativeError = 0;
t->count = 0; t->count = 0;
if (t->timerType != Qt::PreciseTimer) if (t->timerType != Qt::PreciseTimer)
qDebug() << "timer" << t->timerType << hex <<t->id << dec << "interval" << t->interval << "expected at" qDebug() << "timer" << t->timerType << Qt::hex <<t->id << Qt::dec << "interval" << t->interval << "expected at"
<< t->expected << "will fire first at" << t->timeout; << t->expected << "will fire first at" << t->timeout;
#endif #endif
} }
@ -620,7 +620,7 @@ int QTimerInfoList::activateTimers()
currentTimerInfo->cumulativeError += diff; currentTimerInfo->cumulativeError += diff;
++currentTimerInfo->count; ++currentTimerInfo->count;
if (currentTimerInfo->timerType != Qt::PreciseTimer) 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 << currentTimerInfo->interval << "firing at" << currentTime
<< "(orig" << currentTimerInfo->expected << "scheduled at" << currentTimerInfo->timeout << "(orig" << currentTimerInfo->expected << "scheduled at" << currentTimerInfo->timeout
<< ") off by" << diff << "activation" << currentTimerInfo->count << ") off by" << diff << "activation" << currentTimerInfo->count

View File

@ -239,7 +239,7 @@ void QFactoryLoader::update()
library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath());
if (!library->isPlugin()) { if (!library->isPlugin()) {
if (qt_debug_component()) { if (qt_debug_component()) {
qDebug() << library->errorString << endl qDebug() << library->errorString << Qt::endl
<< " not a plugin"; << " not a plugin";
} }
library->release(); library->release();

View File

@ -2941,7 +2941,7 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v)
} }
if (v.isSimpleType()) if (v.isSimpleType())
return dbg << v.toSimpleType(); return dbg << v.toSimpleType();
return dbg << "<unknown type " << hex << int(v.type()) << dec << '>'; return dbg << "<unknown type " << Qt::hex << int(v.type()) << Qt::dec << '>';
} }
QDebug operator<<(QDebug dbg, const QCborValue &v) QDebug operator<<(QDebug dbg, const QCborValue &v)
{ {

View File

@ -316,7 +316,7 @@ QJsonDocument Parser::parse(QJsonParseError *error)
eatBOM(); eatBOM();
char token = nextToken(); char token = nextToken();
DEBUG << hex << (uint)token; DEBUG << Qt::hex << (uint)token;
if (token == BeginArray) { if (token == BeginArray) {
if (!parseArray()) if (!parseArray())
goto error; goto error;

View File

@ -2356,7 +2356,7 @@ void QTextStreamPrivate::putNumber(qulonglong number, bool negative)
} else if (negative) { } else if (negative) {
// Workaround for backward compatibility for writing negative // Workaround for backward compatibility for writing negative
// numbers in octal and hex: // 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 // should output: -0x1 -0b1
result = dd->unsLongLongToString(number, -1, base, -1, flags); result = dd->unsLongLongToString(number, -1, base, -1, flags);
result.prepend(locale.negativeSign()); result.prepend(locale.negativeSign());
@ -2978,7 +2978,7 @@ QTextStream &center(QTextStream &stream)
*/ */
QTextStream &endl(QTextStream &stream) QTextStream &endl(QTextStream &stream)
{ {
return stream << QLatin1Char('\n') << flush; return stream << QLatin1Char('\n') << Qt::flush;
} }
/*! /*!

View File

@ -826,9 +826,9 @@ static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QCha
uint alast = 0; uint alast = 0;
uint blast = 0; uint blast = 0;
while (a < e) { while (a < e) {
// qDebug() << hex << alast << blast; // qDebug() << Qt::hex << alast << blast;
// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); // qDebug() << Qt::hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);
// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); // qDebug() << Qt::hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);
int diff = foldCase(a->unicode(), alast) - foldCase(b->unicode(), blast); int diff = foldCase(a->unicode(), alast) - foldCase(b->unicode(), blast);
if ((diff)) if ((diff))
return diff; return diff;

View File

@ -1858,7 +1858,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
return d; return d;
} }
d.nospace(); d.nospace();
d << "QAccessibleInterface(" << hex << (const void *) iface << dec; d << "QAccessibleInterface(" << Qt::hex << (const void *) iface << Qt::dec;
if (iface->isValid()) { if (iface->isValid()) {
d << " name=" << iface->text(QAccessible::Name) << ' '; d << " name=" << iface->text(QAccessible::Name) << ' ';
d << "role=" << qAccessibleRoleString(iface->role()) << ' '; d << "role=" << qAccessibleRoleString(iface->role()) << ' ';
@ -1897,7 +1897,7 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.nospace() << "QAccessibleEvent("; d.nospace() << "QAccessibleEvent(";
if (ev.object()) { if (ev.object()) {
d.nospace() << "object=" << hex << ev.object() << dec; d.nospace() << "object=" << Qt::hex << ev.object() << Qt::dec;
d.nospace() << "child=" << ev.child(); d.nospace() << "child=" << ev.child();
} else { } else {
d.nospace() << "no object, uniqueId=" << ev.uniqueId(); d.nospace() << "no object, uniqueId=" << ev.uniqueId();

View File

@ -59,7 +59,7 @@ int main(int argv, char **args)
//! [0] //! [0]
for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next()) for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
cout << it.text().toStdString() << endl; cout << it.text().toStdString() << Qt::endl;
//! [0] //! [0]
return 0; return 0;

View File

@ -1496,7 +1496,7 @@ QDebug operator<<(QDebug dbg, const QIcon &i)
if (!i.name().isEmpty()) if (!i.name().isEmpty())
dbg << i.name() << ','; dbg << i.name() << ',';
dbg << "availableSizes[normal,Off]=" << i.availableSizes() 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 << ')'; dbg << ')';
return dbg; return dbg;

View File

@ -1689,7 +1689,7 @@ QDebug operator<<(QDebug dbg, const QPixmap &r)
} else { } else {
dbg << r.size() << ",depth=" << r.depth() dbg << r.size() << ",depth=" << r.depth()
<< ",devicePixelRatio=" << r.devicePixelRatio() << ",devicePixelRatio=" << r.devicePixelRatio()
<< ",cacheKey=" << showbase << hex << r.cacheKey() << dec << noshowbase; << ",cacheKey=" << Qt::showbase << Qt::hex << r.cacheKey() << Qt::dec << Qt::noshowbase;
} }
dbg << ')'; dbg << ')';
return dbg; return dbg;

View File

@ -1129,8 +1129,8 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
// write header // write header
QTextStream s(device); QTextStream s(device);
s << "/* XPM */" << endl s << "/* XPM */" << Qt::endl
<< "static char *" << fbname(fileName) << "[]={" << endl << "static char *" << fbname(fileName) << "[]={" << Qt::endl
<< '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"'; << '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"';
// write palette // write palette
@ -1147,7 +1147,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
qGreen(color), qGreen(color),
qBlue(color)); qBlue(color));
++c; ++c;
s << ',' << endl << line; s << ',' << Qt::endl << line;
} }
// write pixels, limit to 4 characters per pixel // 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); return (s.status() == QTextStream::Ok);
} }

View File

@ -3764,13 +3764,13 @@ static inline void formatTouchEvent(QDebug d, const QTouchEvent &t)
static void formatUnicodeString(QDebug d, const QString &s) static void formatUnicodeString(QDebug d, const QString &s)
{ {
d << '"' << hex; d << '"' << Qt::hex;
for (int i = 0; i < s.size(); ++i) { for (int i = 0; i < s.size(); ++i) {
if (i) if (i)
d << ','; d << ',';
d << "U+" << s.at(i).unicode(); d << "U+" << s.at(i).unicode();
} }
d << dec << '"'; d << Qt::dec << '"';
} }
static inline void formatInputMethodEvent(QDebug d, const QInputMethodEvent *e) static inline void formatInputMethodEvent(QDebug d, const QInputMethodEvent *e)
@ -3807,8 +3807,8 @@ static inline void formatInputMethodQueryEvent(QDebug d, const QInputMethodQuery
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.noquote(); d.noquote();
const Qt::InputMethodQueries queries = e->queries(); const Qt::InputMethodQueries queries = e->queries();
d << "QInputMethodQueryEvent(queries=" << showbase << hex << int(queries) d << "QInputMethodQueryEvent(queries=" << Qt::showbase << Qt::hex << int(queries)
<< noshowbase << dec << ", {"; << Qt::noshowbase << Qt::dec << ", {";
for (unsigned mask = 1; mask <= Qt::ImInputItemClipRectangle; mask<<=1) { for (unsigned mask = 1; mask <= Qt::ImInputItemClipRectangle; mask<<=1) {
if (queries & mask) { if (queries & mask) {
const Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>(mask); const Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>(mask);
@ -4001,7 +4001,7 @@ QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &tp)
{ {
QDebugStateSaver saver(dbg); QDebugStateSaver saver(dbg);
dbg.nospace(); dbg.nospace();
dbg << "TouchPoint(" << hex << tp.id() << dec << " ("; dbg << "TouchPoint(" << Qt::hex << tp.id() << Qt::dec << " (";
QtDebugUtils::formatQPoint(dbg, tp.pos()); QtDebugUtils::formatQPoint(dbg, tp.pos());
dbg << ") "; dbg << ") ";
QtDebugUtils::formatQEnum(dbg, tp.state()); QtDebugUtils::formatQEnum(dbg, tp.state());

View File

@ -1204,7 +1204,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p)
QDebugStateSaver saver(dbg); QDebugStateSaver saver(dbg);
QDebug nospace = dbg.nospace(); QDebug nospace = dbg.nospace();
const uint mask = p.resolve(); 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) { for (int role = 0; role < (int)QPalette::NColorRoles; ++role) {
if (mask & (1<<role)) { if (mask & (1<<role)) {
if (role) if (role)
@ -1220,7 +1220,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p)
nospace << ']'; nospace << ']';
} }
} }
nospace << ')' << noshowbase << dec; nospace << ')' << Qt::noshowbase << Qt::dec;
return dbg; return dbg;
} }
#endif #endif

View File

@ -768,7 +768,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height)
static inline void formatRect(QDebug &debug, const QRect r) static inline void formatRect(QDebug &debug, const QRect r)
{ {
debug << r.width() << 'x' << r.height() debug << r.width() << 'x' << r.height()
<< forcesign << r.x() << r.y() << noforcesign; << Qt::forcesign << r.x() << r.y() << Qt::noforcesign;
} }
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen) Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen)

View File

@ -2835,13 +2835,13 @@ QDebug operator<<(QDebug debug, const QWindow *window)
if (window->isTopLevel()) if (window->isTopLevel())
debug << ", toplevel"; debug << ", toplevel";
debug << ", " << geometry.width() << 'x' << geometry.height() 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(); const QMargins margins = window->frameMargins();
if (!margins.isNull()) if (!margins.isNull())
debug << ", margins=" << margins; debug << ", margins=" << margins;
debug << ", devicePixelRatio=" << window->devicePixelRatio(); debug << ", devicePixelRatio=" << window->devicePixelRatio();
if (const QPlatformWindow *platformWindow = window->handle()) 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()) if (const QScreen *screen = window->screen())
debug << ", on " << screen->name(); debug << ", on " << screen->name();
} }

View File

@ -351,11 +351,11 @@ QDebug operator<<(QDebug dbg, const QGenericMatrix<N, M, T> &m)
QDebugStateSaver saver(dbg); QDebugStateSaver saver(dbg);
dbg.nospace() << "QGenericMatrix<" << N << ", " << M dbg.nospace() << "QGenericMatrix<" << N << ", " << M
<< ", " << QTypeInfo<T>::name() << ", " << QTypeInfo<T>::name()
<< ">(" << endl << qSetFieldWidth(10); << ">(" << Qt::endl << qSetFieldWidth(10);
for (int row = 0; row < M; ++row) { for (int row = 0; row < M; ++row) {
for (int col = 0; col < N; ++col) for (int col = 0; col < N; ++col)
dbg << m(row, col); dbg << m(row, col);
dbg << endl; dbg << Qt::endl;
} }
dbg << qSetFieldWidth(0) << ')'; dbg << qSetFieldWidth(0) << ')';
return dbg; return dbg;

View File

@ -2037,12 +2037,12 @@ QDebug operator<<(QDebug dbg, const QMatrix4x4 &m)
} }
// Output in row-major order because it is more human-readable. // 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) << qSetFieldWidth(10)
<< m(0, 0) << m(0, 1) << m(0, 2) << m(0, 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) << 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) << 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) << endl << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << Qt::endl
<< qSetFieldWidth(0) << ')'; << qSetFieldWidth(0) << ')';
return dbg; return dbg;
} }

View File

@ -136,7 +136,7 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g)
d.nospace(); d.nospace();
d << "Gpu("; d << "Gpu(";
if (g.isValid()) { if (g.isValid()) {
d << "vendor=" << hex << showbase <<g.vendorId << ", device=" << g.deviceId d << "vendor=" << Qt::hex << Qt::showbase <<g.vendorId << ", device=" << g.deviceId
<< "version=" << g.driverVersion; << "version=" << g.driverVersion;
} else { } else {
d << 0; d << 0;

View File

@ -71,10 +71,10 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl,
const int ix = 0x00010000 * sx; const int ix = 0x00010000 * sx;
const int iy = 0x00010000 * sy; const int iy = 0x00010000 * sy;
// qDebug() << "scale:" << endl // qDebug() << "scale:" << Qt::endl
// << " - target" << targetRect << endl // << " - target" << targetRect << Qt::endl
// << " - source" << srcRect << endl // << " - source" << srcRect << Qt::endl
// << " - clip" << clip << endl // << " - clip" << clip << Qt::endl
// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy; // << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
QRect tr = targetRect.normalized().toRect(); QRect tr = targetRect.normalized().toRect();
@ -162,10 +162,10 @@ template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
const int ix = 0x00010000 * sx; const int ix = 0x00010000 * sx;
const int iy = 0x00010000 * sy; const int iy = 0x00010000 * sy;
// qDebug() << "scale:" << endl // qDebug() << "scale:" << Qt::endl
// << " - target" << targetRect << endl // << " - target" << targetRect << Qt::endl
// << " - source" << srcRect << endl // << " - source" << srcRect << Qt::endl
// << " - clip" << clip << endl // << " - clip" << clip << Qt::endl
// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy; // << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
QRect tr = targetRect.normalized().toRect(); QRect tr = targetRect.normalized().toRect();

View File

@ -898,7 +898,7 @@ void QRasterPaintEngine::renderHintsChanged()
QRasterPaintEngineState *s = state(); QRasterPaintEngineState *s = state();
#ifdef QT_DEBUG_DRAW #ifdef QT_DEBUG_DRAW
qDebug() << "QRasterPaintEngine::renderHintsChanged()" << hex << s->renderHints; qDebug() << "QRasterPaintEngine::renderHintsChanged()" << Qt::hex << s->renderHints;
#endif #endif
bool was_aa = s->flags.antialiased; bool was_aa = s->flags.antialiased;
@ -1745,7 +1745,7 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
QRectF rf = path.controlPointRect(); QRectF rf = path.controlPointRect();
qDebug() << "QRasterPaintEngine::fill(): " qDebug() << "QRasterPaintEngine::fill(): "
<< "size=" << path.elementCount() << "size=" << path.elementCount()
<< ", hints=" << hex << path.hints() << ", hints=" << Qt::hex << path.hints()
<< rf << brush; << rf << brush;
#endif #endif

View File

@ -140,7 +140,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path)
QDebugStateSaver saver(s); QDebugStateSaver saver(s);
QRectF rf = path.controlPointRect(); QRectF rf = path.controlPointRect();
s << "QVectorPath(size:" << path.elementCount() s << "QVectorPath(size:" << path.elementCount()
<< " hints:" << hex << path.hints() << " hints:" << Qt::hex << path.hints()
<< rf << ')'; << rf << ')';
return s; return s;
} }

View File

@ -3576,10 +3576,10 @@ void QPainterPath::computeControlPointRect() const
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug s, const QPainterPath &p) 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"}; const char *types[] = {"MoveTo", "LineTo", "CurveTo", "CurveToData"};
for (int i=0; i<p.elementCount(); ++i) { for (int i=0; i<p.elementCount(); ++i) {
s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl; s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << Qt::endl;
} }
return s; return s;

View File

@ -1213,7 +1213,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
end: end:
std::sort(kerning_pairs.begin(), kerning_pairs.end()); std::sort(kerning_pairs.begin(), kerning_pairs.end());
// for (int i = 0; i < kerning_pairs.count(); ++i) // 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;
} }

View File

@ -140,9 +140,9 @@ static inline const uchar *verifyTag(const uchar *tagPtr, const uchar *endPtr)
} }
#if defined(DEBUG_HEADER) #if defined(DEBUG_HEADER)
if (length == 1) if (length == 1)
qDebug() << "tag data" << hex << *tagPtr; qDebug() << "tag data" << Qt::hex << *tagPtr;
else if (length == 4) 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 #endif
} }
return tagPtr + length; return tagPtr + length;
@ -367,7 +367,7 @@ bool QFontEngineQPF2::stringToCMap(const QChar *str, int len, QGlyphLayout *glyp
#if 0 && defined(DEBUG_FONTENGINE) #if 0 && defined(DEBUG_FONTENGINE)
QChar c(uc); QChar c(uc);
if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c)) 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); seenGlyphs.insert(c);
#endif #endif

View File

@ -990,7 +990,7 @@ struct QBidiAlgorithm {
BIDI_DEBUG() << "before implicit level processing:"; BIDI_DEBUG() << "before implicit level processing:";
IsolatedRunSequenceIterator it(runs, i); IsolatedRunSequenceIterator it(runs, i);
while (!it.atEnd()) { 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; ++it;
} }
} }
@ -1003,7 +1003,7 @@ struct QBidiAlgorithm {
BIDI_DEBUG() << "after W4/W5"; BIDI_DEBUG() << "after W4/W5";
IsolatedRunSequenceIterator it(runs, i); IsolatedRunSequenceIterator it(runs, i);
while (!it.atEnd()) { 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; ++it;
} }
} }
@ -1089,7 +1089,7 @@ struct QBidiAlgorithm {
if (BidiDebugEnabled) { if (BidiDebugEnabled) {
BIDI_DEBUG() << ">>>> start bidi, text length" << length; BIDI_DEBUG() << ">>>> start bidi, text length" << length;
for (int i = 0; i < length; ++i) 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) { if (BidiDebugEnabled) {
BIDI_DEBUG() << "final resolved levels:"; BIDI_DEBUG() << "final resolved levels:";
for (int i = 0; i < length; ++i) 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; return true;

View File

@ -127,7 +127,7 @@ QStringList QFreeTypeFontDatabase::addTTFile(const QByteArray &fontData, const Q
error = FT_New_Face(library, file.constData(), index, &face); error = FT_New_Face(library, file.constData(), index, &face);
} }
if (error != FT_Err_Ok) { 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; break;
} }
numFaces = face->num_faces; numFaces = face->num_faces;

View File

@ -75,38 +75,38 @@ QWindowsSockInit2::~QWindowsSockInit2()
#ifdef BEARER_MANAGEMENT_DEBUG #ifdef BEARER_MANAGEMENT_DEBUG
static void printBlob(NLA_BLOB *blob) static void printBlob(NLA_BLOB *blob)
{ {
qDebug() << "==== BEGIN NLA_BLOB ====" << endl qDebug() << "==== BEGIN NLA_BLOB ====" << Qt::endl
<< "type:" << blob->header.type << endl << "type:" << blob->header.type << Qt::endl
<< "size:" << blob->header.dwSize << endl << "size:" << blob->header.dwSize << Qt::endl
<< "next offset:" << blob->header.nextOffset; << "next offset:" << blob->header.nextOffset;
switch (blob->header.type) { switch (blob->header.type) {
case NLA_RAW_DATA: case NLA_RAW_DATA:
qDebug() << "Raw Data" << endl qDebug() << "Raw Data" << Qt::endl
<< '\t' << blob->data.rawData; << '\t' << blob->data.rawData;
break; break;
case NLA_INTERFACE: case NLA_INTERFACE:
qDebug() << "Interface" << endl qDebug() << "Interface" << Qt::endl
<< "\ttype:" << blob->data.interfaceData.dwType << endl << "\ttype:" << blob->data.interfaceData.dwType << Qt::endl
<< "\tspeed:" << blob->data.interfaceData.dwSpeed << endl << "\tspeed:" << blob->data.interfaceData.dwSpeed << Qt::endl
<< "\tadapter:" << blob->data.interfaceData.adapterName; << "\tadapter:" << blob->data.interfaceData.adapterName;
break; break;
case NLA_802_1X_LOCATION: case NLA_802_1X_LOCATION:
qDebug() << "802.1x Location" << endl qDebug() << "802.1x Location" << Qt::endl
<< '\t' << blob->data.locationData.information; << '\t' << blob->data.locationData.information;
break; break;
case NLA_CONNECTIVITY: case NLA_CONNECTIVITY:
qDebug() << "Connectivity" << endl qDebug() << "Connectivity" << Qt::endl
<< "\ttype:" << blob->data.connectivity.type << endl << "\ttype:" << blob->data.connectivity.type << Qt::endl
<< "\tinternet:" << blob->data.connectivity.internet; << "\tinternet:" << blob->data.connectivity.internet;
break; break;
case NLA_ICS: case NLA_ICS:
qDebug() << "ICS" << endl qDebug() << "ICS" << Qt::endl
<< "\tspeed:" << blob->data.ICS.remote.speed << endl << "\tspeed:" << blob->data.ICS.remote.speed << Qt::endl
<< "\ttype:" << blob->data.ICS.remote.type << endl << "\ttype:" << blob->data.ICS.remote.type << Qt::endl
<< "\tstate:" << blob->data.ICS.remote.state << endl << "\tstate:" << blob->data.ICS.remote.state << Qt::endl
<< "\tmachine name:" << blob->data.ICS.remote.machineName << endl << "\tmachine name:" << blob->data.ICS.remote.machineName << Qt::endl
<< "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
break; break;
default: default:

View File

@ -485,7 +485,7 @@ static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring pa
} }
if (Q_UNLIKELY(!m_main)) { if (Q_UNLIKELY(!m_main)) {
qCritical() << "dlsym failed:" << dlerror() << endl qCritical() << "dlsym failed:" << dlerror() << Qt::endl
<< "Could not find main method"; << "Could not find main method";
return false; return false;
} }

View File

@ -177,7 +177,7 @@ NSString *macRole(QAccessibleInterface *interface)
if (roleMap.isEmpty()) if (roleMap.isEmpty())
populateRoleMap(); 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)) { if (roleMap.contains(qtRole)) {
// MAC_ACCESSIBILTY_DEBUG() << "return" << roleMap[qtRole]; // MAC_ACCESSIBILTY_DEBUG() << "return" << roleMap[qtRole];

View File

@ -70,7 +70,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if ([self handleGestureAsBeginEnd:event]) if ([self handleGestureAsBeginEnd:event])
return; 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]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -85,7 +85,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
return; return;
static bool zoomIn = true; 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]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -116,7 +116,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if (!m_platformWindow) if (!m_platformWindow)
return; 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]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
@ -145,7 +145,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&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, QWindowSystemInterface::handleGestureEvent(m_platformWindow->window(), QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), timestamp, Qt::BeginNativeGesture,
windowPoint, screenPoint); windowPoint, screenPoint);
} }
@ -155,7 +155,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if (!m_platformWindow) if (!m_platformWindow)
return; return;
qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << hex << [event deviceID]; qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << Qt::hex << [event deviceID];
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint; QPointF windowPoint;
QPointF screenPoint; QPointF screenPoint;

View File

@ -60,7 +60,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
const NSTimeInterval timestamp = [event timestamp]; const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); const QList<QWindowSystemInterface::TouchPoint> 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); 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 NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); const QList<QWindowSystemInterface::TouchPoint> 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); 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 NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); const QList<QWindowSystemInterface::TouchPoint> 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); 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 NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); const QList<QWindowSystemInterface::TouchPoint> 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); QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points);
} }

View File

@ -157,7 +157,7 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface(EGLConfig eglConfig)
const auto gbmDevice = static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice(); const auto gbmDevice = static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice();
EGLint native_format = -1; EGLint native_format = -1;
EGLBoolean success = eglGetConfigAttrib(display(), eglConfig, EGL_NATIVE_VISUAL_ID, &native_format); 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) if (success)
m_gbm_surface = gbm_surface_create(gbmDevice, m_gbm_surface = gbm_surface_create(gbmDevice,

View File

@ -590,7 +590,7 @@ QString QWindowsContext::registerWindowClass(QString cname,
d->m_registeredWindowClassNames.insert(cname); d->m_registeredWindowClassNames.insert(cname);
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname
<< " style=0x" << hex << style << dec << " style=0x" << Qt::hex << style << Qt::dec
<< " brush=" << brush << " icon=" << icon << " atom=" << atom; << " brush=" << brush << " icon=" << icon << " atom=" << atom;
return cname; 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 (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) {
if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) { if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) {
qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=" << hwnd << ' ' << eventName 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) << ',' << int(wParam) << " at " << GET_X_LPARAM(lParam) << ','
<< GET_Y_LPARAM(lParam) << " handled=" << handled; << GET_Y_LPARAM(lParam) << " handled=" << handled;
} }

View File

@ -736,7 +736,7 @@ QString QWindowsShellItem::libraryItemDefaultSaveFolder(IShellItem *item)
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
void QWindowsShellItem::format(QDebug &d) const void QWindowsShellItem::format(QDebug &d) const
{ {
d << "attributes=0x" << hex << attributes() << dec; d << "attributes=0x" << Qt::hex << attributes() << Qt::dec;
if (isFileSystem()) if (isFileSystem())
d << " [filesys]"; d << " [filesys]";
if (isDir()) if (isDir())
@ -972,7 +972,7 @@ void QWindowsNativeFileDialogBase::doExec(HWND owner)
// gets a WM_CLOSE or the parent window is destroyed. // gets a WM_CLOSE or the parent window is destroyed.
const HRESULT hr = m_fileDialog->Show(owner); const HRESULT hr = m_fileDialog->Show(owner);
QWindowsDialogs::eatMouseMove(); 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. // Emit accepted() only if there is a result as otherwise UI hangs occur.
// For example, typing in invalid URLs results in empty result lists. // For example, typing in invalid URLs results in empty result lists.
if (hr == S_OK && !m_data.selectedFiles().isEmpty()) { if (hr == S_OK && !m_data.selectedFiles().isEmpty()) {
@ -1013,7 +1013,7 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode,
} }
qCDebug(lcQpaDialogs) << __FUNCTION__ << "mode=" << mode qCDebug(lcQpaDialogs) << __FUNCTION__ << "mode=" << mode
<< "acceptMode=" << acceptMode << "options=" << options << "acceptMode=" << acceptMode << "options=" << options
<< "results in" << showbase << hex << flags; << "results in" << Qt::showbase << Qt::hex << flags;
if (FAILED(m_fileDialog->SetOptions(flags))) if (FAILED(m_fileDialog->SetOptions(flags)))
qErrnoWarning("%s: SetOptions() failed", __FUNCTION__); qErrnoWarning("%s: SetOptions() failed", __FUNCTION__);

View File

@ -428,7 +428,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
if (QWindowsContext::verbose > 1 || result != S_OK) { if (QWindowsContext::verbose > 1 || result != S_OK) {
qCDebug(lcQpaMime) << __FUNCTION__ << "fEscapePressed=" << fEscapePressed qCDebug(lcQpaMime) << __FUNCTION__ << "fEscapePressed=" << fEscapePressed
<< "grfKeyState=" << grfKeyState << "buttons" << m_currentButtons << "grfKeyState=" << grfKeyState << "buttons" << m_currentButtons
<< "returns 0x" << hex << int(result) << dec; << "returns 0x" << Qt::hex << int(result) << Qt::dec;
} }
return ResultFromScode(result); return ResultFromScode(result);
} }
@ -710,7 +710,7 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag)
const Qt::DropActions possibleActions = drag->supportedActions(); const Qt::DropActions possibleActions = drag->supportedActions();
const DWORD allowedEffects = translateToWinDragEffects(possibleActions); const DWORD allowedEffects = translateToWinDragEffects(possibleActions);
qCDebug(lcQpaMime) << '>' << __FUNCTION__ << "possible Actions=0x" 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. // Indicate message handlers we are in DoDragDrop() event loop.
QWindowsDrag::m_dragging = true; QWindowsDrag::m_dragging = true;
const HRESULT r = DoDragDrop(dropDataObject, windowDropSource, allowedEffects, &resultEffect); const HRESULT r = DoDragDrop(dropDataObject, windowDropSource, allowedEffects, &resultEffect);
@ -734,9 +734,9 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag)
dropDataObject->releaseQt(); dropDataObject->releaseQt();
dropDataObject->Release(); // Will delete obj if refcount becomes 0 dropDataObject->Release(); // Will delete obj if refcount becomes 0
windowDropSource->Release(); // Will delete src 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 << "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; return dragResult;
} }

View File

@ -243,7 +243,7 @@ QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd)
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.nospace(); d.nospace();
d << "PIXELFORMATDESCRIPTOR " 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_WINDOW) d << " PFD_DRAW_TO_WINDOW";
if (pd.dwFlags & PFD_DRAW_TO_BITMAP) d << " PFD_DRAW_TO_BITMAP"; if (pd.dwFlags & PFD_DRAW_TO_BITMAP) d << " PFD_DRAW_TO_BITMAP";
if (pd.dwFlags & PFD_SUPPORT_GDI) d << " PFD_SUPPORT_GDI"; if (pd.dwFlags & PFD_SUPPORT_GDI) d << " PFD_SUPPORT_GDI";
@ -631,10 +631,10 @@ static int choosePixelFormat(HDC hdc,
nsp << __FUNCTION__; nsp << __FUNCTION__;
if (sampleBuffersRequested) if (sampleBuffersRequested)
nsp << " samples=" << iAttributes[samplesValuePosition]; nsp << " samples=" << iAttributes[samplesValuePosition];
nsp << " Attributes: " << hex << showbase; nsp << " Attributes: " << Qt::hex << Qt::showbase;
for (int ii = 0; ii < i; ++ii) for (int ii = 0; ii < i; ++ii)
nsp << iAttributes[ii] << ','; nsp << iAttributes[ii] << ',';
nsp << noshowbase << dec << "\n obtained px #" << pixelFormat nsp << Qt::noshowbase << Qt::dec << "\n obtained px #" << pixelFormat
<< " of " << numFormats << "\n " << *obtainedPfd; << " of " << numFormats << "\n " << *obtainedPfd;
qCDebug(lcQpaGl) << message; qCDebug(lcQpaGl) << message;
} // Debug } // Debug
@ -784,7 +784,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext,
if (!result) { if (!result) {
QString message; QString message;
QDebug(&message).nospace() << __FUNCTION__ << ": wglCreateContextAttribsARB() failed (GL error code: 0x" 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)); qErrnoWarning("%s", qPrintable(message));
} }
return result; return result;

View File

@ -657,9 +657,9 @@ void QWindowsInputContext::handleInputLanguageChanged(WPARAM wparam, LPARAM lpar
m_locale = qt_localeFromLCID(m_languageId); m_locale = qt_localeFromLCID(m_languageId);
emitLocaleChanged(); emitLocaleChanged();
qCDebug(lcQpaInputMethods) << __FUNCTION__ << hex << showbase qCDebug(lcQpaInputMethods) << __FUNCTION__ << Qt::hex << Qt::showbase
<< oldLanguageId << "->" << newLanguageId << "Character set:" << oldLanguageId << "->" << newLanguageId << "Character set:"
<< DWORD(wparam) << dec << noshowbase << m_locale; << DWORD(wparam) << Qt::dec << Qt::noshowbase << m_locale;
} }
/*! /*!

View File

@ -324,7 +324,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
if (window->type() == Qt::Desktop) { if (window->type() == Qt::Desktop) {
QWindowsDesktopWindow *result = new QWindowsDesktopWindow(window); QWindowsDesktopWindow *result = new QWindowsDesktopWindow(window);
qCDebug(lcQpaWindows) << "Desktop window:" << 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; return result;
} }
@ -373,8 +373,8 @@ QPlatformWindow *QWindowsIntegration::createForeignWindow(QWindow *window, WId n
screen = pScreen->screen(); screen = pScreen->screen();
if (screen && screen != window->screen()) if (screen && screen != window->screen())
window->setScreen(screen); window->setScreen(screen);
qCDebug(lcQpaWindows) << "Foreign window:" << window << showbase << hex qCDebug(lcQpaWindows) << "Foreign window:" << window << Qt::showbase << Qt::hex
<< result->winId() << noshowbase << dec << obtainedGeometry << screen; << result->winId() << Qt::noshowbase << Qt::dec << obtainedGeometry << screen;
return result; return result;
} }

View File

@ -554,7 +554,7 @@ QDebug operator<<(QDebug d, const KeyboardLayoutItem &k)
if (const quint32 qtKey = k.qtKey[i]) { if (const quint32 qtKey = k.qtKey[i]) {
d << '[' << i << ' '; d << '[' << i << ' ';
QtDebugUtils::formatQFlags(d, ModsTbl[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)); QtDebugUtils::formatQEnum(d, Qt::Key(qtKey));
if (qtKey >= 32 && qtKey < 128) if (qtKey >= 32 && qtKey < 128)
d << " '" << char(qtKey) << '\''; d << " '" << char(qtKey) << '\'';
@ -776,7 +776,7 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32
::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast<LPWORD>(&buffer), 0); ::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast<LPWORD>(&buffer), 0);
} }
qCDebug(lcQpaEvents) << __FUNCTION__ << "for virtual key=" 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) static inline QString messageKeyText(const MSG &msg)
@ -1384,7 +1384,7 @@ QList<int> QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
} }
} }
qCDebug(lcQpaEvents) << __FUNCTION__ << e << "nativeVirtualKey=" 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); << e->modifiers() << kbItem << "\n returns" << formatKeys(result);
return result; return result;
} }

View File

@ -896,8 +896,8 @@ void QWindowsMenuItem::formatDebug(QDebug &d) const
d << ", parentMenu=" << static_cast<const void *>(m_parentMenu); d << ", parentMenu=" << static_cast<const void *>(m_parentMenu);
if (m_subMenu) if (m_subMenu)
d << ", subMenu=" << static_cast<const void *>(m_subMenu); d << ", subMenu=" << static_cast<const void *>(m_subMenu);
d << ", tag=" << showbase << hex d << ", tag=" << Qt::showbase << Qt::hex
<< tag() << noshowbase << dec << ", id=" << m_id; << tag() << Qt::noshowbase << Qt::dec << ", id=" << m_id;
#if QT_CONFIG(shortcut) #if QT_CONFIG(shortcut)
if (!m_shortcut.isEmpty()) if (!m_shortcut.isEmpty())
d << ", shortcut=" << m_shortcut; d << ", shortcut=" << m_shortcut;
@ -933,7 +933,7 @@ void QWindowsMenu::formatDebug(QDebug &d) const
if (m_parentMenu != nullptr) if (m_parentMenu != nullptr)
d << " [on menu]"; d << " [on menu]";
if (tag()) if (tag())
d << ", tag=" << showbase << hex << tag() << noshowbase << dec; d << ", tag=" << Qt::showbase << Qt::hex << tag() << Qt::noshowbase << Qt::dec;
if (m_visible) if (m_visible)
d << " [visible]"; d << " [visible]";
if (m_enabled) if (m_enabled)

View File

@ -124,8 +124,8 @@ static inline QTouchDevice *createTouchDevice()
return nullptr; return nullptr;
const int tabletPc = GetSystemMetrics(SM_TABLETPC); const int tabletPc = GetSystemMetrics(SM_TABLETPC);
const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES); const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES);
qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY) qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY)
<< "Ready:" << (digitizers & NID_READY) << dec << noshowbase << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase
<< "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints; << "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints;
QTouchDevice *result = new QTouchDevice; QTouchDevice *result = new QTouchDevice;
result->setType(digitizers & NID_INTEGRATED_TOUCH result->setType(digitizers & NID_INTEGRATED_TOUCH

View File

@ -110,7 +110,7 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
} }
if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled()) 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; return hr;
} }
@ -135,7 +135,7 @@ QWindowsOleDataObject::QueryGetData(LPFORMATETC pformatetc)
ResultFromScode(S_OK) : ResultFromScode(S_FALSE); ResultFromScode(S_OK) : ResultFromScode(S_FALSE);
} }
if (QWindowsContext::verbose > 1) if (QWindowsContext::verbose > 1)
qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr); qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr);
return hr; return hr;
} }
@ -163,7 +163,7 @@ QWindowsOleDataObject::SetData(LPFORMATETC pFormatetc, STGMEDIUM *pMedium, BOOL
hr = ResultFromScode(S_OK); hr = ResultFromScode(S_OK);
} }
if (QWindowsContext::verbose > 1) if (QWindowsContext::verbose > 1)
qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr); qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr);
return hr; return hr;
} }

View File

@ -188,9 +188,9 @@ QDebug operator<<(QDebug d, const GpuDescription &gd)
{ {
QDebugStateSaver s(d); QDebugStateSaver s(d);
d.nospace(); d.nospace();
d << hex << showbase << "GpuDescription(vendorId=" << gd.vendorId d << Qt::hex << Qt::showbase << "GpuDescription(vendorId=" << gd.vendorId
<< ", deviceId=" << gd.deviceId << ", subSysId=" << gd.subSysId << ", deviceId=" << gd.deviceId << ", subSysId=" << gd.subSysId
<< dec << noshowbase << ", revision=" << gd.revision << Qt::dec << Qt::noshowbase << ", revision=" << gd.revision
<< ", driver: " << gd.driverName << ", driver: " << gd.driverName
<< ", version=" << gd.driverVersion << ", " << gd.description << ", version=" << gd.driverVersion << ", " << gd.description
<< gd.gpuSuitableScreen << ')'; << gd.gpuSuitableScreen << ')';
@ -207,11 +207,11 @@ QString GpuDescription::toString() const
<< "\n Driver Name : " << driverName << "\n Driver Name : " << driverName
<< "\n Driver Version : " << driverVersion.toString() << "\n Driver Version : " << driverVersion.toString()
<< "\n Vendor ID : 0x" << qSetPadChar(QLatin1Char('0')) << "\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 Device ID : 0x" << qSetFieldWidth(4) << deviceId
<< "\n SubSys ID : 0x" << qSetFieldWidth(8) << subSysId << "\n SubSys ID : 0x" << qSetFieldWidth(8) << subSysId
<< "\n Revision ID : 0x" << qSetFieldWidth(4) << revision << "\n Revision ID : 0x" << qSetFieldWidth(4) << revision
<< dec; << Qt::dec;
if (!gpuSuitableScreen.isEmpty()) if (!gpuSuitableScreen.isEmpty())
str << "\nGL windows forced to screen: " << gpuSuitableScreen; str << "\nGL windows forced to screen: " << gpuSuitableScreen;
return result; return result;

View File

@ -315,8 +315,8 @@ static QTouchDevice *createTouchDevice()
return nullptr; return nullptr;
const int tabletPc = GetSystemMetrics(SM_TABLETPC); const int tabletPc = GetSystemMetrics(SM_TABLETPC);
const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES); const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES);
qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY) qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY)
<< "Ready:" << (digitizers & NID_READY) << dec << noshowbase << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase
<< "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints; << "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints;
QTouchDevice *result = new QTouchDevice; QTouchDevice *result = new QTouchDevice;
result->setType(digitizers & NID_INTEGRATED_TOUCH result->setType(digitizers & NID_INTEGRATED_TOUCH
@ -469,19 +469,19 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
QList<QWindowSystemInterface::TouchPoint> touchPoints; QList<QWindowSystemInterface::TouchPoint> touchPoints;
if (QWindowsContext::verbose > 1) if (QWindowsContext::verbose > 1)
qCDebug(lcQpaEvents).noquote().nospace() << showbase qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< __FUNCTION__ << __FUNCTION__
<< " message=" << hex << msg.message << " message=" << Qt::hex << msg.message
<< " count=" << dec << count; << " count=" << Qt::dec << count;
Qt::TouchPointStates allStates = 0; Qt::TouchPointStates allStates = 0;
for (quint32 i = 0; i < count; ++i) { for (quint32 i = 0; i < count; ++i) {
if (QWindowsContext::verbose > 1) if (QWindowsContext::verbose > 1)
qCDebug(lcQpaEvents).noquote().nospace() << showbase qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< " TouchPoint id=" << touchInfo[i].pointerInfo.pointerId << " TouchPoint id=" << touchInfo[i].pointerInfo.pointerId
<< " frame=" << touchInfo[i].pointerInfo.frameId << " frame=" << touchInfo[i].pointerInfo.frameId
<< " flags=" << hex << touchInfo[i].pointerInfo.pointerFlags; << " flags=" << Qt::hex << touchInfo[i].pointerInfo.pointerFlags;
QWindowSystemInterface::TouchPoint touchPoint; QWindowSystemInterface::TouchPoint touchPoint;
const quint32 pointerId = touchInfo[i].pointerInfo.pointerId; const quint32 pointerId = touchInfo[i].pointerInfo.pointerId;
@ -563,11 +563,11 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
const int z = 0; const int z = 0;
if (QWindowsContext::verbose > 1) if (QWindowsContext::verbose > 1)
qCDebug(lcQpaEvents).noquote().nospace() << showbase qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< __FUNCTION__ << " sourceDevice=" << sourceDevice << __FUNCTION__ << " sourceDevice=" << sourceDevice
<< " globalPos=" << globalPos << " localPos=" << localPos << " hiResGlobalPos=" << hiResGlobalPos << " globalPos=" << globalPos << " localPos=" << localPos << " hiResGlobalPos=" << hiResGlobalPos
<< " message=" << hex << msg.message << " message=" << Qt::hex << msg.message
<< " flags=" << hex << penInfo->pointerInfo.pointerFlags; << " flags=" << Qt::hex << penInfo->pointerInfo.pointerFlags;
const QTabletEvent::TabletDevice device = QTabletEvent::Stylus; const QTabletEvent::TabletDevice device = QTabletEvent::Stylus;
QTabletEvent::PointerType type; QTabletEvent::PointerType type;

View File

@ -146,13 +146,13 @@ QDebug operator<<(QDebug d, const LOGCONTEXT &lc)
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.nospace(); d.nospace();
d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x" d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x"
<< hex << lc.lcOptions << dec; << Qt::hex << lc.lcOptions << Qt::dec;
formatOptions(d, lc.lcOptions); formatOptions(d, lc.lcOptions);
d << ", status=0x" << hex << lc.lcStatus << ", device=0x" << lc.lcDevice d << ", status=0x" << Qt::hex << lc.lcStatus << ", device=0x" << lc.lcDevice
<< dec << ", PktRate=" << lc.lcPktRate << Qt::dec << ", PktRate=" << lc.lcPktRate
<< ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode << ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode
<< ", MoveMask=0x" << hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask << ", MoveMask=0x" << Qt::hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask
<< ", BtnUpMask=0x" << lc.lcBtnUpMask << dec << ", SysMode=" << lc.lcSysMode << ", BtnUpMask=0x" << lc.lcBtnUpMask << Qt::dec << ", SysMode=" << lc.lcSysMode
<< ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ << ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ
<< "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ << "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ
<< ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", " << ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", "
@ -305,7 +305,7 @@ QString QWindowsTabletSupport::description() const
<< '.' << (specificationVersion & 0xFF) << " implementation: v" << '.' << (specificationVersion & 0xFF) << " implementation: v"
<< (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF) << (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF)
<< ' ' << devices << " device(s), " << cursors << " cursor(s), " << ' ' << 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); formatOptions(str, opts);
if (m_tiltSupport) if (m_tiltSupport)
str << " tilt"; str << " tilt";

View File

@ -238,7 +238,7 @@ QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp)
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.nospace(); d.nospace();
d.noquote(); 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 << wp.showCmd << ", ptMinPosition=" << wp.ptMinPosition << ", ptMaxPosition=" << wp.ptMaxPosition
<< ", rcNormalPosition=" << wp.rcNormalPosition; << ", rcNormalPosition=" << wp.rcNormalPosition;
return d; return d;
@ -248,7 +248,7 @@ QDebug operator<<(QDebug d, const GUID &guid)
{ {
QDebugStateSaver saver(d); QDebugStateSaver saver(d);
d.nospace(); d.nospace();
d << '{' << hex << uppercasedigits << qSetPadChar(QLatin1Char('0')) d << '{' << Qt::hex << Qt::uppercasedigits << qSetPadChar(QLatin1Char('0'))
<< qSetFieldWidth(8) << guid.Data1 << qSetFieldWidth(8) << guid.Data1
<< qSetFieldWidth(0) << '-' << qSetFieldWidth(4) << qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
<< guid.Data2 << 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), const QMargins result(qAbs(rect.left), qAbs(rect.top),
qAbs(rect.right), qAbs(rect.bottom)); qAbs(rect.right), qAbs(rect.bottom));
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << " style=" 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; << ' ' << rect << ' ' << result;
return result; return result;
} }

View File

@ -636,13 +636,13 @@ static void dumpNativeWindowsRecursion(const QXcbConnection *connection, xcb_win
const QChar oldPadChar =str.padChar(); const QChar oldPadChar =str.padChar();
str.setFieldWidth(8); str.setFieldWidth(8);
str.setPadChar(QLatin1Char('0')); str.setPadChar(QLatin1Char('0'));
str << hex << window; str << Qt::hex << window;
str.setFieldWidth(oldFieldWidth); str.setFieldWidth(oldFieldWidth);
str.setPadChar(oldPadChar); str.setPadChar(oldPadChar);
str << dec << " \"" str << Qt::dec << " \""
<< QXcbWindow::windowTitle(connection, window) << "\" " << QXcbWindow::windowTitle(connection, window) << "\" "
<< geom.width() << 'x' << geom.height() << forcesign << geom.x() << geom.y() << geom.width() << 'x' << geom.height() << Qt::forcesign << geom.x() << geom.y()
<< noforcesign << '\n'; << Qt::noforcesign << '\n';
auto reply = Q_XCB_REPLY(xcb_query_tree, conn, window); auto reply = Q_XCB_REPLY(xcb_query_tree, conn, window);
if (reply) { if (reply) {

View File

@ -915,7 +915,7 @@ QByteArray QXcbScreen::getEdid() const
static inline void formatRect(QDebug &debug, const QRect r) static inline void formatRect(QDebug &debug, const QRect r)
{ {
debug << r.width() << 'x' << r.height() 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) static inline void formatSizeF(QDebug &debug, const QSizeF s)
@ -929,7 +929,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen)
debug.nospace(); debug.nospace();
debug << "QXcbScreen(" << (const void *)screen; debug << "QXcbScreen(" << (const void *)screen;
if (screen) { if (screen) {
debug << fixed << qSetRealNumberPrecision(1); debug << Qt::fixed << qSetRealNumberPrecision(1);
debug << ", name=" << screen->name(); debug << ", name=" << screen->name();
debug << ", geometry="; debug << ", geometry=";
formatRect(debug, screen->geometry()); formatRect(debug, screen->geometry());
@ -947,7 +947,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen)
debug << "), orientation=" << screen->orientation(); debug << "), orientation=" << screen->orientation();
debug << ", depth=" << screen->depth(); debug << ", depth=" << screen->depth();
debug << ", refreshRate=" << screen->refreshRate(); debug << ", refreshRate=" << screen->refreshRate();
debug << ", root=" << hex << screen->root(); debug << ", root=" << Qt::hex << screen->root();
debug << ", windowManagerName=" << screen->windowManagerName(); debug << ", windowManagerName=" << screen->windowManagerName();
} }
debug << ')'; debug << ')';

View File

@ -213,7 +213,7 @@ void QSqlQuery_snippets()
while (i.hasNext()) { while (i.hasNext()) {
i.next(); i.next();
cout << i.key().toUtf8().data() << ": " cout << i.key().toUtf8().data() << ": "
<< i.value().toString().toUtf8().data() << endl; << i.value().toString().toUtf8().data() << Qt::endl;
} }
//! [14] //! [14]
} }
@ -223,7 +223,7 @@ void QSqlQuery_snippets()
//! [15] //! [15]
QList<QVariant> list = query.boundValues().values(); QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i) 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] //! [15]
} }
} }

View File

@ -535,7 +535,7 @@ QDebug operator<<(QDebug dbg, const QSqlRecord &r)
dbg << "QSqlRecord(" << count << ')'; dbg << "QSqlRecord(" << count << ')';
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
dbg.nospace(); 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.space();
dbg << r.field(i) << r.value(i).toString(); dbg << r.field(i) << r.value(i).toString();
} }

View File

@ -161,22 +161,22 @@ static QString moc(const QString &name)
static QTextStream &writeHeader(QTextStream &ts, bool changesWillBeLost) static QTextStream &writeHeader(QTextStream &ts, bool changesWillBeLost)
{ {
ts << "/*" << endl ts << "/*" << Qt::endl
<< " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << endl << " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << Qt::endl
<< " * Command line was: " << commandLine << endl << " * Command line was: " << commandLine << Qt::endl
<< " *" << endl << " *" << Qt::endl
<< " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << endl << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << Qt::endl
<< " *" << endl << " *" << Qt::endl
<< " * This is an auto-generated file." << endl; << " * This is an auto-generated file." << Qt::endl;
if (changesWillBeLost) 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 else
ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << endl ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << Qt::endl
<< " * before re-generating it." << endl; << " * before re-generating it." << Qt::endl;
ts << " */" << endl ts << " */" << Qt::endl
<< endl; << Qt::endl;
return ts; return ts;
} }
@ -466,66 +466,66 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
} }
includeGuard = QString(QLatin1String("%1")) includeGuard = QString(QLatin1String("%1"))
.arg(includeGuard); .arg(includeGuard);
hs << "#ifndef " << includeGuard << endl hs << "#ifndef " << includeGuard << Qt::endl
<< "#define " << includeGuard << endl << "#define " << includeGuard << Qt::endl
<< endl; << Qt::endl;
// include our stuff: // include our stuff:
hs << "#include <QtCore/QObject>" << endl hs << "#include <QtCore/QObject>" << Qt::endl
<< includeList << includeList
<< "#include <QtDBus/QtDBus>" << endl; << "#include <QtDBus/QtDBus>" << Qt::endl;
for (const QString &include : qAsConst(includes)) { for (const QString &include : qAsConst(includes)) {
hs << "#include \"" << include << "\"" << endl; hs << "#include \"" << include << "\"" << Qt::endl;
if (headerName.isEmpty()) if (headerName.isEmpty())
cs << "#include \"" << include << "\"" << endl; cs << "#include \"" << include << "\"" << Qt::endl;
} }
hs << endl; hs << Qt::endl;
if (cppName != headerName) { if (cppName != headerName) {
if (!headerName.isEmpty() && headerName != QLatin1String("-")) if (!headerName.isEmpty() && headerName != QLatin1String("-"))
cs << "#include \"" << headerName << "\"" << endl << endl; cs << "#include \"" << headerName << "\"" << Qt::endl << Qt::endl;
} }
for (const QDBusIntrospection::Interface *interface : interfaces) { for (const QDBusIntrospection::Interface *interface : interfaces) {
QString className = classNameForInterface(interface->name, Proxy); QString className = classNameForInterface(interface->name, Proxy);
// comment: // comment:
hs << "/*" << endl hs << "/*" << Qt::endl
<< " * Proxy class for interface " << interface->name << endl << " * Proxy class for interface " << interface->name << Qt::endl
<< " */" << endl; << " */" << Qt::endl;
cs << "/*" << endl cs << "/*" << Qt::endl
<< " * Implementation of interface class " << className << endl << " * Implementation of interface class " << className << Qt::endl
<< " */" << endl << " */" << Qt::endl
<< endl; << Qt::endl;
// class header: // class header:
hs << "class " << className << ": public QDBusAbstractInterface" << endl hs << "class " << className << ": public QDBusAbstractInterface" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " Q_OBJECT" << endl; << " Q_OBJECT" << Qt::endl;
// the interface name // the interface name
hs << "public:" << endl hs << "public:" << Qt::endl
<< " static inline const char *staticInterfaceName()" << endl << " static inline const char *staticInterfaceName()" << Qt::endl
<< " { return \"" << interface->name << "\"; }" << endl << " { return \"" << interface->name << "\"; }" << Qt::endl
<< endl; << Qt::endl;
// constructors/destructors: // constructors/destructors:
hs << "public:" << endl hs << "public:" << Qt::endl
<< " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << endl << " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << Qt::endl
<< endl << Qt::endl
<< " ~" << className << "();" << endl << " ~" << className << "();" << Qt::endl
<< endl; << Qt::endl;
cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << endl cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << Qt::endl
<< " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << endl << " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< endl << Qt::endl
<< className << "::~" << className << "()" << endl << className << "::~" << className << "()" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< endl; << Qt::endl;
// properties: // properties:
for (const QDBusIntrospection::Property &property : interface->properties) { for (const QDBusIntrospection::Property &property : interface->properties) {
@ -545,27 +545,27 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
// it's writeable // it's writeable
hs << " WRITE " << setter; hs << " WRITE " << setter;
hs << ")" << endl; hs << ")" << Qt::endl;
// getter: // getter:
if (property.access != QDBusIntrospection::Property::Write) { if (property.access != QDBusIntrospection::Property::Write) {
hs << " inline " << type << " " << getter << "() const" << endl hs << " inline " << type << " " << getter << "() const" << Qt::endl
<< " { return qvariant_cast< " << type << " >(property(\"" << " { return qvariant_cast< " << type << " >(property(\""
<< property.name << "\")); }" << endl; << property.name << "\")); }" << Qt::endl;
} }
// setter: // setter:
if (property.access != QDBusIntrospection::Property::Read) { 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 << " { setProperty(\"" << property.name
<< "\", QVariant::fromValue(value)); }" << endl; << "\", QVariant::fromValue(value)); }" << Qt::endl;
} }
hs << endl; hs << Qt::endl;
} }
// methods: // methods:
hs << "public Q_SLOTS: // METHODS" << endl; hs << "public Q_SLOTS: // METHODS" << Qt::endl;
for (const QDBusIntrospection::Method &method : interface->methods) { for (const QDBusIntrospection::Method &method : interface->methods) {
bool isDeprecated = method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == QLatin1String("true"); bool isDeprecated = method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == QLatin1String("true");
bool isNoReply = bool isNoReply =
@ -595,26 +595,26 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
QStringList argNames = makeArgNames(method.inputArgs); QStringList argNames = makeArgNames(method.inputArgs);
writeArgList(hs, argNames, method.annotations, method.inputArgs); writeArgList(hs, argNames, method.annotations, method.inputArgs);
hs << ")" << endl hs << ")" << Qt::endl
<< " {" << endl << " {" << Qt::endl
<< " QList<QVariant> argumentList;" << endl; << " QList<QVariant> argumentList;" << Qt::endl;
if (!method.inputArgs.isEmpty()) { if (!method.inputArgs.isEmpty()) {
hs << " argumentList"; hs << " argumentList";
for (int argPos = 0; argPos < method.inputArgs.count(); ++argPos) for (int argPos = 0; argPos < method.inputArgs.count(); ++argPos)
hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')'; hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')';
hs << ";" << endl; hs << ";" << Qt::endl;
} }
if (isNoReply) if (isNoReply)
hs << " callWithArgumentList(QDBus::NoBlock, " hs << " callWithArgumentList(QDBus::NoBlock, "
<< "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl; << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl;
else else
hs << " return asyncCallWithArgumentList(QStringLiteral(\"" hs << " return asyncCallWithArgumentList(QStringLiteral(\""
<< method.name << "\"), argumentList);" << endl; << method.name << "\"), argumentList);" << Qt::endl;
// close the function: // close the function:
hs << " }" << endl; hs << " }" << Qt::endl;
if (method.outputArgs.count() > 1) { if (method.outputArgs.count() > 1) {
// generate the old-form QDBusReply methods with multiple incoming parameters // 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); QStringList argNames = makeArgNames(method.inputArgs, method.outputArgs);
writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs); writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs);
hs << ")" << endl hs << ")" << Qt::endl
<< " {" << endl << " {" << Qt::endl
<< " QList<QVariant> argumentList;" << endl; << " QList<QVariant> argumentList;" << Qt::endl;
int argPos = 0; int argPos = 0;
if (!method.inputArgs.isEmpty()) { if (!method.inputArgs.isEmpty()) {
hs << " argumentList"; hs << " argumentList";
for (argPos = 0; argPos < method.inputArgs.count(); ++argPos) for (argPos = 0; argPos < method.inputArgs.count(); ++argPos)
hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')'; hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')';
hs << ";" << endl; hs << ";" << Qt::endl;
} }
hs << " QDBusMessage reply = callWithArgumentList(QDBus::Block, " hs << " QDBusMessage reply = callWithArgumentList(QDBus::Block, "
<< "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl; << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl;
argPos++; argPos++;
hs << " if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == " hs << " if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == "
<< method.outputArgs.count() << ") {" << endl; << method.outputArgs.count() << ") {" << Qt::endl;
// yes, starting from 1 // yes, starting from 1
for (int i = 1; i < method.outputArgs.count(); ++i) for (int i = 1; i < method.outputArgs.count(); ++i)
hs << " " << argNames.at(argPos++) << " = qdbus_cast<" hs << " " << argNames.at(argPos++) << " = qdbus_cast<"
<< templateArg(qtTypeName(method.outputArgs.at(i).type, method.annotations, i, "Out")) << templateArg(qtTypeName(method.outputArgs.at(i).type, method.annotations, i, "Out"))
<< ">(reply.arguments().at(" << i << "));" << endl; << ">(reply.arguments().at(" << i << "));" << Qt::endl;
hs << " }" << endl hs << " }" << Qt::endl
<< " return reply;" << endl << " return reply;" << Qt::endl
<< " }" << 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_) { for (const QDBusIntrospection::Signal &signal : interface->signals_) {
hs << " "; hs << " ";
if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == 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); QStringList argNames = makeArgNames(signal.outputArgs);
writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs);
hs << ");" << endl; // finished for header hs << ");" << Qt::endl; // finished for header
} }
// close the class: // close the class:
hs << "};" << endl hs << "};" << Qt::endl
<< endl; << Qt::endl;
} }
if (!skipNamespaces) { if (!skipNamespaces) {
@ -698,17 +698,17 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
// i parts matched // i parts matched
// close last.arguments().count() - i namespaces: // close last.arguments().count() - i namespaces:
for (int j = i; j < last.count(); ++j) 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 // open current.arguments().count() - i namespaces
for (int j = i; j < current.count(); ++j) 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: // add this class:
if (!name.isEmpty()) { if (!name.isEmpty()) {
hs << QString(current.count() * 2, QLatin1Char(' ')) hs << QString(current.count() * 2, QLatin1Char(' '))
<< "typedef ::" << classNameForInterface(it->constData()->name, Proxy) << "typedef ::" << classNameForInterface(it->constData()->name, Proxy)
<< " " << name << ";" << endl; << " " << name << ";" << Qt::endl;
} }
if (it == interfaces.constEnd()) if (it == interfaces.constEnd())
@ -719,12 +719,12 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
} }
// close the include guard // close the include guard
hs << "#endif" << endl; hs << "#endif" << Qt::endl;
QString mocName = moc(filename); QString mocName = moc(filename);
if (includeMocs && !mocName.isEmpty()) if (includeMocs && !mocName.isEmpty())
cs << endl cs << Qt::endl
<< "#include \"" << mocName << "\"" << endl; << "#include \"" << mocName << "\"" << Qt::endl;
cs.flush(); cs.flush();
hs.flush(); hs.flush();
@ -772,36 +772,36 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
} }
includeGuard = QString(QLatin1String("%1")) includeGuard = QString(QLatin1String("%1"))
.arg(includeGuard); .arg(includeGuard);
hs << "#ifndef " << includeGuard << endl hs << "#ifndef " << includeGuard << Qt::endl
<< "#define " << includeGuard << endl << "#define " << includeGuard << Qt::endl
<< endl; << Qt::endl;
// include our stuff: // include our stuff:
hs << "#include <QtCore/QObject>" << endl; hs << "#include <QtCore/QObject>" << Qt::endl;
if (cppName == headerName) if (cppName == headerName)
hs << "#include <QtCore/QMetaObject>" << endl hs << "#include <QtCore/QMetaObject>" << Qt::endl
<< "#include <QtCore/QVariant>" << endl; << "#include <QtCore/QVariant>" << Qt::endl;
hs << "#include <QtDBus/QtDBus>" << endl; hs << "#include <QtDBus/QtDBus>" << Qt::endl;
for (const QString &include : qAsConst(includes)) { for (const QString &include : qAsConst(includes)) {
hs << "#include \"" << include << "\"" << endl; hs << "#include \"" << include << "\"" << Qt::endl;
if (headerName.isEmpty()) if (headerName.isEmpty())
cs << "#include \"" << include << "\"" << endl; cs << "#include \"" << include << "\"" << Qt::endl;
} }
if (cppName != headerName) { if (cppName != headerName) {
if (!headerName.isEmpty() && headerName != QLatin1String("-")) if (!headerName.isEmpty() && headerName != QLatin1String("-"))
cs << "#include \"" << headerName << "\"" << endl; cs << "#include \"" << headerName << "\"" << Qt::endl;
cs << "#include <QtCore/QMetaObject>" << endl cs << "#include <QtCore/QMetaObject>" << Qt::endl
<< includeList << includeList
<< endl; << Qt::endl;
hs << forwardDeclarations; hs << forwardDeclarations;
} else { } else {
hs << includeList; hs << includeList;
} }
hs << endl; hs << Qt::endl;
QString parent = parentClassName; QString parent = parentClassName;
if (parentClassName.isEmpty()) if (parentClassName.isEmpty())
@ -811,47 +811,47 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
QString className = classNameForInterface(interface->name, Adaptor); QString className = classNameForInterface(interface->name, Adaptor);
// comment: // comment:
hs << "/*" << endl hs << "/*" << Qt::endl
<< " * Adaptor class for interface " << interface->name << endl << " * Adaptor class for interface " << interface->name << Qt::endl
<< " */" << endl; << " */" << Qt::endl;
cs << "/*" << endl cs << "/*" << Qt::endl
<< " * Implementation of adaptor class " << className << endl << " * Implementation of adaptor class " << className << Qt::endl
<< " */" << endl << " */" << Qt::endl
<< endl; << Qt::endl;
// class header: // class header:
hs << "class " << className << ": public QDBusAbstractAdaptor" << endl hs << "class " << className << ": public QDBusAbstractAdaptor" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " Q_OBJECT" << endl << " Q_OBJECT" << Qt::endl
<< " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << endl << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << Qt::endl
<< " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << endl << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << Qt::endl
<< stringify(interface->introspection) << stringify(interface->introspection)
<< " \"\")" << endl << " \"\")" << Qt::endl
<< "public:" << endl << "public:" << Qt::endl
<< " " << className << "(" << parent << " *parent);" << endl << " " << className << "(" << parent << " *parent);" << Qt::endl
<< " virtual ~" << className << "();" << endl << " virtual ~" << className << "();" << Qt::endl
<< endl; << Qt::endl;
if (!parentClassName.isEmpty()) if (!parentClassName.isEmpty())
hs << " inline " << parent << " *parent() const" << endl hs << " inline " << parent << " *parent() const" << Qt::endl
<< " { return static_cast<" << parent << " *>(QObject::parent()); }" << endl << " { return static_cast<" << parent << " *>(QObject::parent()); }" << Qt::endl
<< endl; << Qt::endl;
// constructor/destructor // constructor/destructor
cs << className << "::" << className << "(" << parent << " *parent)" << endl cs << className << "::" << className << "(" << parent << " *parent)" << Qt::endl
<< " : QDBusAbstractAdaptor(parent)" << endl << " : QDBusAbstractAdaptor(parent)" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " // constructor" << endl << " // constructor" << Qt::endl
<< " setAutoRelaySignals(true);" << endl << " setAutoRelaySignals(true);" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< endl << Qt::endl
<< className << "::~" << className << "()" << endl << className << "::~" << className << "()" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " // destructor" << endl << " // destructor" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< endl; << Qt::endl;
hs << "public: // PROPERTIES" << endl; hs << "public: // PROPERTIES" << Qt::endl;
for (const QDBusIntrospection::Property &property : interface->properties) { for (const QDBusIntrospection::Property &property : interface->properties) {
QByteArray type = qtTypeName(property.type, property.annotations); QByteArray type = qtTypeName(property.type, property.annotations);
QString constRefType = constRefArg(type); QString constRefType = constRefArg(type);
@ -863,38 +863,38 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
hs << " READ " << getter; hs << " READ " << getter;
if (property.access != QDBusIntrospection::Property::Read) if (property.access != QDBusIntrospection::Property::Read)
hs << " WRITE " << setter; hs << " WRITE " << setter;
hs << ")" << endl; hs << ")" << Qt::endl;
// getter: // getter:
if (property.access != QDBusIntrospection::Property::Write) { if (property.access != QDBusIntrospection::Property::Write) {
hs << " " << type << " " << getter << "() const;" << endl; hs << " " << type << " " << getter << "() const;" << Qt::endl;
cs << type << " " cs << type << " "
<< className << "::" << getter << "() const" << endl << className << "::" << getter << "() const" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " // get the value of property " << property.name << endl << " // get the value of property " << property.name << Qt::endl
<< " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << endl << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< endl; << Qt::endl;
} }
// setter // setter
if (property.access != QDBusIntrospection::Property::Read) { if (property.access != QDBusIntrospection::Property::Read) {
hs << " void " << setter << "(" << constRefType << "value);" << endl; hs << " void " << setter << "(" << constRefType << "value);" << Qt::endl;
cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << endl cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " // set the value of property " << property.name << endl << " // set the value of property " << property.name << Qt::endl
<< " parent()->setProperty(\"" << property.name << "\", QVariant::fromValue(value"; << " parent()->setProperty(\"" << property.name << "\", QVariant::fromValue(value";
if (constRefType.contains(QLatin1String("QDBusVariant"))) if (constRefType.contains(QLatin1String("QDBusVariant")))
cs << ".variant()"; cs << ".variant()";
cs << "));" << endl cs << "));" << Qt::endl
<< "}" << endl << "}" << Qt::endl
<< 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) { for (const QDBusIntrospection::Method &method : interface->methods) {
bool isNoReply = bool isNoReply =
method.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true"); 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(hs, argNames, method.annotations, method.inputArgs, method.outputArgs);
writeArgList(cs, argNames, method.annotations, method.inputArgs, method.outputArgs); writeArgList(cs, argNames, method.annotations, method.inputArgs, method.outputArgs);
hs << ");" << endl; // finished for header hs << ");" << Qt::endl; // finished for header
cs << ")" << endl cs << ")" << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< " // handle method call " << interface->name << "." << methodName(method) << endl; << " // handle method call " << interface->name << "." << methodName(method) << Qt::endl;
// make the call // make the call
bool usingInvokeMethod = false; bool usingInvokeMethod = false;
@ -945,7 +945,7 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
// we are using QMetaObject::invokeMethod // we are using QMetaObject::invokeMethod
if (!returnType.isEmpty()) if (!returnType.isEmpty())
cs << " " << returnType << " " << argNames.at(method.inputArgs.count()) cs << " " << returnType << " " << argNames.at(method.inputArgs.count())
<< ";" << endl; << ";" << Qt::endl;
static const char invoke[] = " QMetaObject::invokeMethod(parent(), \""; static const char invoke[] = " QMetaObject::invokeMethod(parent(), \"";
cs << invoke << name << "\""; cs << invoke << name << "\"";
@ -966,10 +966,10 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
<< argNames.at(i) << argNames.at(i)
<< ")"; << ")";
cs << ");" << endl; cs << ");" << Qt::endl;
if (!returnType.isEmpty()) if (!returnType.isEmpty())
cs << " return " << argNames.at(method.inputArgs.count()) << ";" << endl; cs << " return " << argNames.at(method.inputArgs.count()) << ";" << Qt::endl;
} else { } else {
if (parentClassName.isEmpty()) if (parentClassName.isEmpty())
cs << " //"; cs << " //";
@ -997,13 +997,13 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
first = false; first = false;
} }
cs << ");" << endl; cs << ");" << Qt::endl;
} }
cs << "}" << endl cs << "}" << Qt::endl
<< endl; << Qt::endl;
} }
hs << "Q_SIGNALS: // SIGNALS" << endl; hs << "Q_SIGNALS: // SIGNALS" << Qt::endl;
for (const QDBusIntrospection::Signal &signal : interface->signals_) { for (const QDBusIntrospection::Signal &signal : interface->signals_) {
hs << " "; hs << " ";
if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == 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); QStringList argNames = makeArgNames(signal.outputArgs);
writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs); writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs);
hs << ");" << endl; // finished for header hs << ");" << Qt::endl; // finished for header
} }
// close the class: // close the class:
hs << "};" << endl hs << "};" << Qt::endl
<< endl; << Qt::endl;
} }
// close the include guard // close the include guard
hs << "#endif" << endl; hs << "#endif" << Qt::endl;
QString mocName = moc(filename); QString mocName = moc(filename);
if (includeMocs && !mocName.isEmpty()) if (includeMocs && !mocName.isEmpty())
cs << endl cs << Qt::endl
<< "#include \"" << mocName << "\"" << endl; << "#include \"" << mocName << "\"" << Qt::endl;
cs.flush(); cs.flush();
hs.flush(); hs.flush();

View File

@ -43,7 +43,7 @@ void generateSeparator(int i, QTextStream &out)
if (!(i % 10)) { if (!(i % 10)) {
if (i) if (i)
out << ","; out << ",";
out << endl << " "; out << Qt::endl << " ";
} else { } else {
out << ", "; out << ", ";
} }
@ -187,14 +187,14 @@ void CppGenerator::operator () ()
{ {
if (verbose) if (verbose)
qout() << "*** Warning. Found a reduce/reduce conflict in state " << q << " on token ``" << s << "'' between rule " 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; ++reduce_reduce_conflict_count;
u = qMax (u, -r); u = qMax (u, -r);
if (verbose) if (verbose)
qout() << "\tresolved using rule " << -u << endl; qout() << "\tresolved using rule " << -u << Qt::endl;
} }
else if (u > 0) else if (u > 0)
@ -227,7 +227,7 @@ void CppGenerator::operator () ()
++shift_reduce_conflict_count; ++shift_reduce_conflict_count;
if (verbose) 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 if (shift_reduce_conflict_count != grammar.expected_shift_reduce
|| reduce_reduce_conflict_count != grammar.expected_reduce_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) if (verbose)
qout() << endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl qout() << Qt::endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << Qt::endl
<< endl; << Qt::endl;
} }
QBitArray used_rules (grammar.rules.count ()); QBitArray used_rules (grammar.rules.count ());
@ -266,7 +266,7 @@ void CppGenerator::operator () ()
RulePointer rule = grammar.rules.begin () + i; RulePointer rule = grammar.rules.begin () + i;
if (rule != grammar.goal) 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() out << copyrightHeader()
<< privateCopyrightHeader() << privateCopyrightHeader()
<< endl; << Qt::endl;
} }
out << "// This file was generated by qlalr - DO NOT EDIT!\n"; 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) { if (copyright) {
out << "#if defined(ERROR)" << endl out << "#if defined(ERROR)" << Qt::endl
<< "# undef ERROR" << endl << "# undef ERROR" << Qt::endl
<< "#endif" << endl << endl; << "#endif" << Qt::endl << Qt::endl;
} }
generateDecl (out); generateDecl (out);
generateImpl (out); generateImpl (out);
out << p.decls(); out << p.decls();
out << p.impls(); out << p.impls();
out << endl; out << Qt::endl;
out << endIncludeGuard(grammar.merged_output) << endl; out << endIncludeGuard(grammar.merged_output) << Qt::endl;
return; return;
} }
@ -388,24 +388,24 @@ void CppGenerator::operator () ()
{ {
out << copyrightHeader() out << copyrightHeader()
<< privateCopyrightHeader() << privateCopyrightHeader()
<< endl; << Qt::endl;
} }
out << "// This file was generated by qlalr - DO NOT EDIT!\n"; out << "// This file was generated by qlalr - DO NOT EDIT!\n";
out << "#ifndef " << prot << endl out << "#ifndef " << prot << Qt::endl
<< "#define " << prot << endl << "#define " << prot << Qt::endl
<< endl; << Qt::endl;
if (copyright) { if (copyright) {
out << "#include <QtCore/qglobal.h>" << endl << endl; out << "#include <QtCore/qglobal.h>" << Qt::endl << Qt::endl;
out << "QT_BEGIN_NAMESPACE" << endl << endl; out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl;
} }
generateDecl (out); generateDecl (out);
if (copyright) 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 } // end decls
{ // bits... { // bits...
@ -419,12 +419,12 @@ void CppGenerator::operator () ()
out << "// This file was generated by qlalr - DO NOT EDIT!\n"; 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) if (copyright)
out << "QT_BEGIN_NAMESPACE" << endl << endl; out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl;
generateImpl(out); generateImpl(out);
if (copyright) if (copyright)
out << "QT_END_NAMESPACE" << endl; out << "QT_END_NAMESPACE" << Qt::endl;
} // end bits } // end bits
@ -455,10 +455,10 @@ QString CppGenerator::debugInfoProt() const
void CppGenerator::generateDecl (QTextStream &out) void CppGenerator::generateDecl (QTextStream &out)
{ {
out << "class " << grammar.table_name << endl out << "class " << grammar.table_name << Qt::endl
<< "{" << endl << "{" << Qt::endl
<< "public:" << endl << "public:" << Qt::endl
<< " enum VariousConstants {" << endl; << " enum VariousConstants {" << Qt::endl;
for (const Name &t : qAsConst(grammar.terminals)) for (const Name &t : qAsConst(grammar.terminals))
{ {
@ -474,62 +474,62 @@ void CppGenerator::generateDecl (QTextStream &out)
else else
name.prepend (grammar.token_prefix); name.prepend (grammar.token_prefix);
out << " " << name << " = " << value << "," << endl; out << " " << name << " = " << value << "," << Qt::endl;
} }
out << endl out << Qt::endl
<< " ACCEPT_STATE = " << accept_state << "," << endl << " ACCEPT_STATE = " << accept_state << "," << Qt::endl
<< " RULE_COUNT = " << grammar.rules.size () << "," << endl << " RULE_COUNT = " << grammar.rules.size () << "," << Qt::endl
<< " STATE_COUNT = " << state_count << "," << endl << " STATE_COUNT = " << state_count << "," << Qt::endl
<< " TERMINAL_COUNT = " << terminal_count << "," << endl << " TERMINAL_COUNT = " << terminal_count << "," << Qt::endl
<< " NON_TERMINAL_COUNT = " << non_terminal_count << "," << endl << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << Qt::endl
<< endl << Qt::endl
<< " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << endl << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << Qt::endl
<< " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << endl << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << Qt::endl
<< " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << endl << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << Qt::endl
<< " };" << endl << " };" << Qt::endl
<< endl << Qt::endl
<< " static const char *const spell[];" << endl << " static const char *const spell[];" << Qt::endl
<< " static const short lhs[];" << endl << " static const short lhs[];" << Qt::endl
<< " static const short rhs[];" << endl; << " static const short rhs[];" << Qt::endl;
if (debug_info) if (debug_info)
{ {
QString prot = debugInfoProt(); QString prot = debugInfoProt();
out << endl << "#ifndef " << prot << endl out << Qt::endl << "#ifndef " << prot << Qt::endl
<< " static const int rule_index[];" << endl << " static const int rule_index[];" << Qt::endl
<< " static const int rule_info[];" << endl << " static const int rule_info[];" << Qt::endl
<< "#endif // " << prot << endl << endl; << "#endif // " << prot << Qt::endl << Qt::endl;
} }
out << " static const short goto_default[];" << endl out << " static const short goto_default[];" << Qt::endl
<< " static const short action_default[];" << endl << " static const short action_default[];" << Qt::endl
<< " static const short action_index[];" << endl << " static const short action_index[];" << Qt::endl
<< " static const short action_info[];" << endl << " static const short action_info[];" << Qt::endl
<< " static const short action_check[];" << endl << " static const short action_check[];" << Qt::endl
<< endl << Qt::endl
<< " static inline int nt_action (int state, int nt)" << endl << " static inline int nt_action (int state, int nt)" << Qt::endl
<< " {" << endl << " {" << Qt::endl
<< " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << endl << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << Qt::endl
<< " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << endl << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << Qt::endl
<< " return goto_default [nt];" << endl << " return goto_default [nt];" << Qt::endl
<< endl << Qt::endl
<< " return action_info [GOTO_INFO_OFFSET + yyn];" << endl << " return action_info [GOTO_INFO_OFFSET + yyn];" << Qt::endl
<< " }" << endl << " }" << Qt::endl
<< endl << Qt::endl
<< " static inline int t_action (int state, int token)" << endl << " static inline int t_action (int state, int token)" << Qt::endl
<< " {" << endl << " {" << Qt::endl
<< " const int yyn = action_index [state] + token;" << endl << " const int yyn = action_index [state] + token;" << Qt::endl
<< endl << Qt::endl
<< " if (yyn < 0 || action_check [yyn] != token)" << endl << " if (yyn < 0 || action_check [yyn] != token)" << Qt::endl
<< " return - action_default [state];" << endl << " return - action_default [state];" << Qt::endl
<< endl << Qt::endl
<< " return action_info [yyn];" << endl << " return action_info [yyn];" << Qt::endl
<< " }" << endl << " }" << Qt::endl
<< "};" << endl << "};" << Qt::endl
<< endl << Qt::endl
<< endl; << Qt::endl;
} }
void CppGenerator::generateImpl (QTextStream &out) void CppGenerator::generateImpl (QTextStream &out)
@ -568,16 +568,16 @@ void CppGenerator::generateImpl (QTextStream &out)
{ {
first_nt = false; first_nt = false;
QString prot = debugInfoProt(); QString prot = debugInfoProt();
out << endl << "#ifndef " << prot << endl; out << Qt::endl << "#ifndef " << prot << Qt::endl;
} }
out << "\"" << *t << "\""; out << "\"" << *t << "\"";
} }
} }
if (debug_info) 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 [] = {"; out << "const short " << grammar.table_name << "::lhs [] = {";
idx = 0; idx = 0;
@ -587,7 +587,7 @@ void CppGenerator::generateImpl (QTextStream &out)
out << aut.id (rule->lhs); out << aut.id (rule->lhs);
} }
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::rhs [] = {"; out << "const short " << grammar.table_name << "::rhs [] = {";
idx = 0; idx = 0;
@ -597,13 +597,13 @@ void CppGenerator::generateImpl (QTextStream &out)
out << rule->rhs.size (); out << rule->rhs.size ();
} }
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
if (debug_info) if (debug_info)
{ {
QString prot = debugInfoProt(); QString prot = debugInfoProt();
out << endl << "#ifndef " << prot << endl; out << Qt::endl << "#ifndef " << prot << Qt::endl;
out << "const int " << grammar.table_name << "::rule_info [] = {"; out << "const int " << grammar.table_name << "::rule_info [] = {";
idx = 0; idx = 0;
for (auto rule = grammar.rules.cbegin (); rule != grammar.rules.cend (); ++rule, ++idx) 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) for (const Name &n : rule->rhs)
out << ", " << name_ids.value (n); out << ", " << name_ids.value (n);
} }
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const int " << grammar.table_name << "::rule_index [] = {"; out << "const int " << grammar.table_name << "::rule_index [] = {";
idx = 0; idx = 0;
@ -627,8 +627,8 @@ void CppGenerator::generateImpl (QTextStream &out)
out << offset; out << offset;
offset += rule->rhs.size () + 1; offset += rule->rhs.size () + 1;
} }
out << endl << "};" << endl out << Qt::endl << "};" << Qt::endl
<< "#endif // " << prot << endl << endl; << "#endif // " << prot << Qt::endl << Qt::endl;
} }
out << "const short " << grammar.table_name << "::action_default [] = {"; out << "const short " << grammar.table_name << "::action_default [] = {";
@ -642,27 +642,27 @@ void CppGenerator::generateImpl (QTextStream &out)
else else
out << "0"; out << "0";
} }
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::goto_default [] = {"; out << "const short " << grammar.table_name << "::goto_default [] = {";
generateList(defgoto, out); generateList(defgoto, out);
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_index [] = {"; out << "const short " << grammar.table_name << "::action_index [] = {";
generateList(compressed_action.index, out); generateList(compressed_action.index, out);
out << "," << endl; out << "," << Qt::endl;
generateList(compressed_goto.index, out); generateList(compressed_goto.index, out);
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_info [] = {"; out << "const short " << grammar.table_name << "::action_info [] = {";
generateList(compressed_action.info, out); generateList(compressed_action.info, out);
out << "," << endl; out << "," << Qt::endl;
generateList(compressed_goto.info, out); generateList(compressed_goto.info, out);
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_check [] = {"; out << "const short " << grammar.table_name << "::action_check [] = {";
generateList(compressed_action.check, out); generateList(compressed_action.check, out);
out << "," << endl; out << "," << Qt::endl;
generateList(compressed_goto.check, out); generateList(compressed_goto.check, out);
out << endl << "};" << endl << endl; out << Qt::endl << "};" << Qt::endl << Qt::endl;
} }

View File

@ -41,9 +41,9 @@ void DotGraph::operator () (Automaton *aut)
{ {
Grammar *g = aut->_M_grammar; 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 (); for (Automaton::IncludesGraph::iterator incl = Automaton::IncludesGraph::begin_nodes ();
incl != Automaton::IncludesGraph::end_nodes (); ++incl) incl != Automaton::IncludesGraph::end_nodes (); ++incl)
{ {
@ -53,14 +53,14 @@ void DotGraph::operator () (Automaton *aut)
out << "\t->\t"; out << "\t->\t";
out << "\"(" << aut->id ((*edge)->data.state) << ", " << (*edge)->data.nt << ")\"\t"; out << "\"(" << aut->id ((*edge)->data.state) << ", " << (*edge)->data.nt << ")\"\t";
out << "[label=\"" << incl->data.state->follows [incl->data.nt] << "\"]"; 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 << "subgraph LRA {" << Qt::endl;
//out << "node [shape=record];" << endl << endl; //out << "node [shape=record];" << Qt::endl << Qt::endl;
for (StatePointer q = aut->states.begin (); q != aut->states.end (); ++q) 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) for (ItemPointer item = q->kernel.begin (); item != q->kernel.end (); ++item)
out << "| <" << index++ << "> " << *item; out << "| <" << index++ << "> " << *item;
out << "}\"]" << endl; out << "}\"]" << Qt::endl;
for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a) for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a)
{ {
const char *clr = g->isTerminal (a.key ()) ? "blue" : "red"; 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 << "}" << Qt::endl;
out << endl << endl << "}" << endl; out << Qt::endl << Qt::endl << "}" << Qt::endl;
} }

View File

@ -313,7 +313,7 @@ void Automaton::buildNullables ()
} }
#ifndef QLALR_NO_DEBUG_NULLABLES #ifndef QLALR_NO_DEBUG_NULLABLES
qerr() << "nullables = {" << nullables << endl; qerr() << "nullables = {" << nullables << Qt::endl;
#endif #endif
} }
@ -456,7 +456,7 @@ void Automaton::buildLookbackSets ()
lookbacks.insert (item, Lookback (p, A)); lookbacks.insert (item, Lookback (p, A));
#ifndef QLALR_NO_DEBUG_LOOKBACKS #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 #endif
} }
} }
@ -487,7 +487,7 @@ void Automaton::buildDirectReads ()
#ifndef QLALR_NO_DEBUG_DIRECT_READS #ifndef QLALR_NO_DEBUG_DIRECT_READS
for (QMap<Name, NameSet>::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr) for (QMap<Name, NameSet>::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 #endif
} }
} }
@ -520,7 +520,7 @@ void Automaton::buildReadsDigraph ()
dump (qerr(), source); dump (qerr(), source);
qerr() << " reads "; qerr() << " reads ";
dump (qerr(), target); dump (qerr(), target);
qerr() << endl; qerr() << Qt::endl;
#endif #endif
} }
} }
@ -555,7 +555,7 @@ void Automaton::visitReadNode (ReadNode node)
_M_reads_stack.push (node); _M_reads_stack.push (node);
#ifndef QLALR_NO_DEBUG_INCLUDES #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 #endif
for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge) for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
@ -635,7 +635,7 @@ void Automaton::buildIncludesDigraph ()
source->insertEdge (target); source->insertEdge (target);
#ifndef QLALR_NO_DEBUG_INCLUDES #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 #endif // QLALR_NO_DEBUG_INCLUDES
continue; continue;
@ -657,7 +657,7 @@ void Automaton::buildIncludesDigraph ()
source->insertEdge (target); source->insertEdge (target);
#ifndef QLALR_NO_DEBUG_INCLUDES #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 #endif // QLALR_NO_DEBUG_INCLUDES
} }
} }
@ -674,7 +674,7 @@ void Automaton::visitIncludeNode (IncludeNode node)
_M_includes_stack.push (node); _M_includes_stack.push (node);
#ifndef QLALR_NO_DEBUG_INCLUDES #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 #endif
for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge) for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
@ -690,7 +690,7 @@ void Automaton::visitIncludeNode (IncludeNode node)
dump (qerr(), node); dump (qerr(), node);
qerr() << " += follows"; qerr() << " += follows";
dump (qerr(), r); dump (qerr(), r);
qerr() << endl; qerr() << Qt::endl;
#endif #endif
NameSet &dst = node->data.state->follows [node->data.nt]; NameSet &dst = node->data.state->follows [node->data.nt];
@ -726,7 +726,7 @@ void Automaton::buildLookaheads ()
#ifndef QLALR_NO_DEBUG_LOOKAHEADS #ifndef QLALR_NO_DEBUG_LOOKAHEADS
qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks "; qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks ";
dump (qerr(), lookback); 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 #endif
lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ()); lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ());

View File

@ -261,7 +261,7 @@ int Recognizer::nextToken()
if (ch == QLatin1Char ('"')) if (ch == QLatin1Char ('"'))
inp (); inp ();
else else
qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl; qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl;
_M_current_value = text; _M_current_value = text;
return (token = STRING_LITERAL); return (token = STRING_LITERAL);
@ -314,7 +314,7 @@ int Recognizer::nextToken()
return (token = PREC); return (token = PREC);
else 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); exit (EXIT_FAILURE);
return (token = ERROR); return (token = ERROR);
} }
@ -659,7 +659,7 @@ case $rule_number: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) 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; return false;
} }
@ -683,7 +683,7 @@ case $rule_number: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) 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; return false;
} }
@ -712,7 +712,7 @@ case $rule_number: {
Name tok = _M_grammar->intern (sym(2)); Name tok = _M_grammar->intern (sym(2));
if (! _M_grammar->isTerminal (tok)) 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 (); _M_current_rule->prec = _M_grammar->names.end ();
} }
else 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; return false;
} }

View File

@ -44,15 +44,15 @@
static void help_me () static void help_me ()
{ {
qerr() << "Usage: qlalr [options] [input file name]" << endl qerr() << "Usage: qlalr [options] [input file name]" << Qt::endl
<< endl << Qt::endl
<< " --help, -h\t\tdisplay this help and exit" << endl << " --help, -h\t\tdisplay this help and exit" << Qt::endl
<< " --verbose, -v\t\tverbose output" << endl << " --verbose, -v\t\tverbose output" << Qt::endl
<< " --no-debug\t\tno debug information" << endl << " --no-debug\t\tno debug information" << Qt::endl
<< " --no-lines\t\tno #line directives" << endl << " --no-lines\t\tno #line directives" << Qt::endl
<< " --dot\t\t\tgenerate a graph" << endl << " --dot\t\t\tgenerate a graph" << Qt::endl
<< " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << endl << " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << Qt::endl
<< endl; << Qt::endl;
exit (0); exit (0);
} }
@ -91,7 +91,7 @@ int main (int argc, char *argv[])
file_name = arg; file_name = arg;
else else
qerr() << "*** Warning. Ignore argument `" << arg << "'" << endl; qerr() << "*** Warning. Ignore argument `" << arg << "'" << Qt::endl;
} }
if (file_name.isEmpty ()) if (file_name.isEmpty ())
@ -108,13 +108,13 @@ int main (int argc, char *argv[])
if (grammar.rules.isEmpty ()) if (grammar.rules.isEmpty ())
{ {
qerr() << "*** Fatal. No rules!" << endl; qerr() << "*** Fatal. No rules!" << Qt::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
else if (grammar.start == grammar.names.end ()) else if (grammar.start == grammar.names.end ())
{ {
qerr() << "*** Fatal. No start symbol!" << endl; qerr() << "*** Fatal. No start symbol!" << Qt::endl;
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }

View File

@ -43,13 +43,13 @@ void ParseTable::operator () (Automaton *aut)
int rindex = 1; int rindex = 1;
for (RulePointer rule = g->rules.begin (); rule != g->rules.end (); ++rule) for (RulePointer rule = g->rules.begin (); rule != g->rules.end (); ++rule)
out << rindex++ << ")\t" << *rule << endl; out << rindex++ << ")\t" << *rule << Qt::endl;
out << endl << endl; out << Qt::endl << Qt::endl;
int index = 0; int index = 0;
for (StatePointer state = aut->states.begin (); state != aut->states.end (); ++state) 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) 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 ()) if (item->dot == item->end_rhs ())
out << " " << aut->lookaheads [item]; out << " " << aut->lookaheads [item];
out << endl; out << Qt::endl;
} }
bool first = true; bool first = true;
@ -68,11 +68,11 @@ void ParseTable::operator () (Automaton *aut)
continue; continue;
if (first) if (first)
out << endl; out << Qt::endl;
first = false; 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; first = true;
@ -82,13 +82,13 @@ void ParseTable::operator () (Automaton *aut)
continue; continue;
if (first) if (first)
out << endl; out << Qt::endl;
first = false; first = false;
const auto lookaheads = aut->lookaheads.value(item); const auto lookaheads = aut->lookaheads.value(item);
for (const Name &la : lookaheads) 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; first = true;
@ -98,19 +98,19 @@ void ParseTable::operator () (Automaton *aut)
continue; continue;
if (first) if (first)
out << endl; out << Qt::endl;
first = false; 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 ()) if (state->defaultReduce != g->rules.end ())
{ {
out << endl out << Qt::endl
<< " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << endl; << " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << Qt::endl;
} }
out << endl; out << Qt::endl;
} }
} }

View File

@ -97,7 +97,7 @@ int Recognizer::nextToken()
if (ch == QLatin1Char ('"')) if (ch == QLatin1Char ('"'))
inp (); inp ();
else else
qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl; qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl;
_M_current_value = text; _M_current_value = text;
return (token = STRING_LITERAL); return (token = STRING_LITERAL);
@ -150,7 +150,7 @@ int Recognizer::nextToken()
return (token = PREC); return (token = PREC);
else 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); exit (EXIT_FAILURE);
return (token = ERROR); return (token = ERROR);
} }
@ -405,7 +405,7 @@ case 34: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) 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; return false;
} }
@ -420,7 +420,7 @@ case 38: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ()) 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; return false;
} }
@ -443,7 +443,7 @@ case 40: {
Name tok = _M_grammar->intern (sym(2)); Name tok = _M_grammar->intern (sym(2));
if (! _M_grammar->isTerminal (tok)) 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 (); _M_current_rule->prec = _M_grammar->names.end ();
} }
else 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; return false;
} }

View File

@ -1626,7 +1626,7 @@ QString WriteInitialization::writeFontProperties(const DomFont *f)
} }
if (f->hasElementWeight() && f->elementWeight() > 0) { if (f->hasElementWeight() && f->elementWeight() > 0) {
m_output << m_indent << fontName << ".setWeight(" m_output << m_indent << fontName << ".setWeight("
<< f->elementWeight() << ");" << endl; << f->elementWeight() << ");" << Qt::endl;
} }
if (f->hasElementStrikeOut()) { if (f->hasElementStrikeOut()) {
m_output << m_indent << fontName << ".setStrikeOut(" m_output << m_indent << fontName << ".setStrikeOut("
@ -2614,7 +2614,7 @@ static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QS
outputStream << "#if " << language::qtConfig(list.constFirst()); outputStream << "#if " << language::qtConfig(list.constFirst());
for (int i = 1, size = list.size(); i < size; ++i) for (int i = 1, size = list.size(); i < size; ++i)
outputStream << " || " << language::qtConfig(list.at(i)); outputStream << " || " << language::qtConfig(list.at(i));
outputStream << endl; outputStream << Qt::endl;
} }
static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet<QString> &directives) static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet<QString> &directives)
@ -2622,7 +2622,7 @@ static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet<QStr
if (directives.isEmpty()) if (directives.isEmpty())
return; return;
outputStream << "#endif" << endl; outputStream << "#endif" << Qt::endl;
} }
WriteInitialization::Item::Item(const QString &itemClassName, const QString &indent, QTextStream &setupUiStream, QTextStream &retranslateUiStream, Driver *driver) WriteInitialization::Item::Item(const QString &itemClassName, const QString &indent, QTextStream &setupUiStream, QTextStream &retranslateUiStream, Driver *driver)
@ -2680,7 +2680,7 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
while (it != m_setupUiData.setters.constEnd()) { while (it != m_setupUiData.setters.constEnd()) {
if (!it.key().isEmpty()) if (!it.key().isEmpty())
m_setupUiStream << language::openQtConfig(it.key()); m_setupUiStream << language::openQtConfig(it.key());
m_setupUiStream << m_indent << uniqueName << it.value() << endl; m_setupUiStream << m_indent << uniqueName << it.value() << Qt::endl;
if (!it.key().isEmpty()) if (!it.key().isEmpty())
m_setupUiStream << language::closeQtConfig(it.key()); m_setupUiStream << language::closeQtConfig(it.key());
++it; ++it;
@ -2718,7 +2718,7 @@ void WriteInitialization::Item::writeRetranslateUi(const QString &parentPath)
m_retranslateUiStream << language::openQtConfig(newDirective); m_retranslateUiStream << language::openQtConfig(newDirective);
oldDirective = newDirective; oldDirective = newDirective;
} }
m_retranslateUiStream << m_indent << uniqueName << it.value() << endl; m_retranslateUiStream << m_indent << uniqueName << it.value() << Qt::endl;
++it; ++it;
} }
if (!oldDirective.isEmpty()) if (!oldDirective.isEmpty())

View File

@ -210,7 +210,7 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
void QSpanCollection::updateInsertedRows(int start, int end) void QSpanCollection::updateInsertedRows(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end << endl << index; qDebug() << start << end << Qt::endl << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -258,7 +258,7 @@ void QSpanCollection::updateInsertedRows(int start, int end)
void QSpanCollection::updateInsertedColumns(int start, int end) void QSpanCollection::updateInsertedColumns(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end << endl << index; qDebug() << start << end << Qt::endl << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -339,7 +339,7 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int
void QSpanCollection::updateRemovedRows(int start, int end) void QSpanCollection::updateRemovedRows(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end << endl << index; qDebug() << start << end << Qt::endl << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -466,7 +466,7 @@ void QSpanCollection::updateRemovedRows(int start, int end)
void QSpanCollection::updateRemovedColumns(int start, int end) void QSpanCollection::updateRemovedColumns(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end << endl << index; qDebug() << start << end << Qt::endl << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;

View File

@ -13180,7 +13180,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
if (widget->isWindow()) if (widget->isWindow())
debug << ", window"; debug << ", window";
debug << ", " << geometry.width() << 'x' << geometry.height() debug << ", " << geometry.width() << 'x' << geometry.height()
<< forcesign << geometry.x() << geometry.y() << noforcesign; << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign;
if (frameGeometry != geometry) { if (frameGeometry != geometry) {
const QMargins margins(geometry.x() - frameGeometry.x(), const QMargins margins(geometry.x() - frameGeometry.x(),
geometry.y() - frameGeometry.y(), geometry.y() - frameGeometry.y(),
@ -13190,7 +13190,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
} }
debug << ", devicePixelRatio=" << widget->devicePixelRatioF(); debug << ", devicePixelRatio=" << widget->devicePixelRatioF();
if (const WId wid = widget->internalWinId()) if (const WId wid = widget->internalWinId())
debug << ", winId=0x" << hex << wid << dec; debug << ", winId=0x" << Qt::hex << wid << Qt::dec;
} }
debug << ')'; debug << ')';
} else { } else {

View File

@ -1793,7 +1793,7 @@ void QSplitter::setStretchFactor(int index, int stretch)
QTextStream& operator<<(QTextStream& ts, const QSplitter& splitter) QTextStream& operator<<(QTextStream& ts, const QSplitter& splitter)
{ {
ts << splitter.saveState() << endl; ts << splitter.saveState() << Qt::endl;
return ts; return ts;
} }

View File

@ -74,7 +74,7 @@ QDomNode n = d.firstChild();
while (!n.isNull()) { while (!n.isNull()) {
if (n.isElement()) { if (n.isElement()) {
QDomElement e = n.toElement(); QDomElement e = n.toElement();
cout << "Element name: " << e.tagName() << endl; cout << "Element name: " << e.tagName() << Qt::endl;
break; break;
} }
n = n.nextSibling(); n = n.nextSibling();
@ -126,10 +126,10 @@ QDomElement element4 = document.createElement("MyElement");
QDomElement e = //... QDomElement e = //...
//... //...
QDomAttr a = e.attributeNode("href"); 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 a.setValue("http://qt-project.org/doc"); // change the node's attribute
QDomAttr a2 = e.attributeNode("href"); 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] //! [8]
@ -201,7 +201,7 @@ QDomNode n = docElem.firstChild();
while(!n.isNull()) { while(!n.isNull()) {
QDomElement e = n.toElement(); // try to convert the node to an element. QDomElement e = n.toElement(); // try to convert the node to an element.
if(!e.isNull()) { 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(); n = n.nextSibling();
} }

View File

@ -3598,7 +3598,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const
} }
if (entities->length()>0 || notations->length()>0) { if (entities->length()>0 || notations->length()>0) {
s << " [" << endl; s << " [" << Qt::endl;
QHash<QString, QDomNodePrivate *>::const_iterator it2 = notations->map.constBegin(); QHash<QString, QDomNodePrivate *>::const_iterator it2 = notations->map.constBegin();
for (; it2 != notations->map.constEnd(); ++it2) for (; it2 != notations->map.constEnd(); ++it2)
@ -3611,7 +3611,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const
s << ']'; s << ']';
} }
s << '>' << endl; s << '>' << Qt::endl;
} }
/************************************************************** /**************************************************************
@ -4627,7 +4627,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
/* -1 disables new lines. */ /* -1 disables new lines. */
if (indent != -1) if (indent != -1)
s << endl; s << Qt::endl;
} }
QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText()) QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText())
s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); 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())) { if (!(next && next->isText())) {
/* -1 disables new lines. */ /* -1 disables new lines. */
if (indent != -1) if (indent != -1)
s << endl; s << Qt::endl;
} }
} }
@ -5329,7 +5329,7 @@ void QDomCommentPrivate::save(QTextStream& s, int depth, int indent) const
s << "-->"; s << "-->";
if (!(next && next->isText())) if (!(next && next->isText()))
s << endl; s << Qt::endl;
} }
/************************************************************** /**************************************************************
@ -5552,7 +5552,7 @@ void QDomNotationPrivate::save(QTextStream& s, int, int) const
} else { } else {
s << "SYSTEM " << quotedValue(m_sys); 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); _name = QLatin1String("% ") + _name.mid(1);
if (m_sys.isNull() && m_pub.isNull()) { if (m_sys.isNull() && m_pub.isNull()) {
s << "<!ENTITY " << _name << " \"" << encodeEntity(value.toUtf8()) << "\">" << endl; s << "<!ENTITY " << _name << " \"" << encodeEntity(value.toUtf8()) << "\">" << Qt::endl;
} else { } else {
s << "<!ENTITY " << _name << ' '; s << "<!ENTITY " << _name << ' ';
if (m_pub.isNull()) { if (m_pub.isNull()) {
@ -5744,7 +5744,7 @@ void QDomEntityPrivate::save(QTextStream& s, int, int) const
if (! m_notationName.isNull()) { if (! m_notationName.isNull()) {
s << " NDATA " << m_notationName; s << " NDATA " << m_notationName;
} }
s << '>' << endl; s << '>' << Qt::endl;
} }
} }
@ -6014,7 +6014,7 @@ QDomNodePrivate* QDomProcessingInstructionPrivate::cloneNode(bool deep)
void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const
{ {
s << "<?" << name << ' ' << value << "?>" << endl; s << "<?" << name << ' ' << value << "?>" << Qt::endl;
} }
/************************************************************** /**************************************************************