forked from qt-creator/qt-creator
tests: Remove foreach usage
Task-number: QTCREATORBUG-27464 Change-Id: I0e42da9b04793be959ad050fdecc0c78c98d9fcd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -152,23 +152,23 @@ struct Line {
|
|||||||
int expectedPadding;
|
int expectedPadding;
|
||||||
};
|
};
|
||||||
|
|
||||||
QString concatLines(QList<Line> lines)
|
QString concatLines(const QList<Line> &lines)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
foreach (const Line &l, lines) {
|
for (const Line &l : lines) {
|
||||||
result += l.line;
|
result += l.line;
|
||||||
result += "\n";
|
result += "\n";
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIndent(QList<Line> data, QtStyleCodeFormatter formatter)
|
void checkIndent(const QList<Line> &data, QtStyleCodeFormatter formatter)
|
||||||
{
|
{
|
||||||
QString text = concatLines(data);
|
QString text = concatLines(data);
|
||||||
QTextDocument document(text);
|
QTextDocument document(text);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (const Line &l, data) {
|
for (const Line &l : data) {
|
||||||
QTextBlock b = document.findBlockByLineNumber(i);
|
QTextBlock b = document.findBlockByLineNumber(i);
|
||||||
if (l.expectedIndent != -1) {
|
if (l.expectedIndent != -1) {
|
||||||
int indent, padding;
|
int indent, padding;
|
||||||
@@ -183,14 +183,14 @@ void checkIndent(QList<Line> data, QtStyleCodeFormatter formatter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIndent(QList<Line> data, CppCodeStyleSettings style)
|
void checkIndent(QList<Line> &data, CppCodeStyleSettings style)
|
||||||
{
|
{
|
||||||
QtStyleCodeFormatter formatter;
|
QtStyleCodeFormatter formatter;
|
||||||
formatter.setCodeStyleSettings(style);
|
formatter.setCodeStyleSettings(style);
|
||||||
checkIndent(data, formatter);
|
checkIndent(data, formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIndent(QList<Line> data, int style = 0)
|
void checkIndent(QList<Line> &data, int style = 0)
|
||||||
{
|
{
|
||||||
CppCodeStyleSettings codeStyle;
|
CppCodeStyleSettings codeStyle;
|
||||||
QtStyleCodeFormatter formatter;
|
QtStyleCodeFormatter formatter;
|
||||||
|
@@ -81,7 +81,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(tst_SimpleLexer::TokenCompareFlags)
|
|||||||
Tokens tst_SimpleLexer::toTokens(const TokenKindList &tokenKinds)
|
Tokens tst_SimpleLexer::toTokens(const TokenKindList &tokenKinds)
|
||||||
{
|
{
|
||||||
Tokens tokens;
|
Tokens tokens;
|
||||||
foreach (unsigned tokenKind, tokenKinds) {
|
for (unsigned tokenKind : tokenKinds) {
|
||||||
Token token;
|
Token token;
|
||||||
token.f.kind = tokenKind;
|
token.f.kind = tokenKind;
|
||||||
tokens << token;
|
tokens << token;
|
||||||
|
@@ -203,7 +203,7 @@ public:
|
|||||||
|
|
||||||
QString resolveGlobally(const QString ¤tFileName) const
|
QString resolveGlobally(const QString ¤tFileName) const
|
||||||
{
|
{
|
||||||
foreach (const QDir &dir, m_includePaths) {
|
for (const QDir &dir : m_includePaths) {
|
||||||
QFileInfo f(dir, currentFileName);
|
QFileInfo f(dir, currentFileName);
|
||||||
if (f.exists())
|
if (f.exists())
|
||||||
return f.filePath();
|
return f.filePath();
|
||||||
@@ -214,7 +214,7 @@ public:
|
|||||||
|
|
||||||
void setIncludePaths(const QStringList &includePaths)
|
void setIncludePaths(const QStringList &includePaths)
|
||||||
{
|
{
|
||||||
foreach (const QString &path, includePaths) {
|
for (const QString &path : includePaths) {
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
if (dir.exists())
|
if (dir.exists())
|
||||||
m_includePaths.append(dir);
|
m_includePaths.append(dir);
|
||||||
@@ -292,7 +292,7 @@ namespace QTest {
|
|||||||
template<> char *toString(const QList<int> &list)
|
template<> char *toString(const QList<int> &list)
|
||||||
{
|
{
|
||||||
QByteArray ba = "QList<int>(";
|
QByteArray ba = "QList<int>(";
|
||||||
foreach (const int& item, list) {
|
for (const int &item : list) {
|
||||||
ba += QTest::toString(item);
|
ba += QTest::toString(item);
|
||||||
ba += ',';
|
ba += ',';
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ namespace QTest {
|
|||||||
template<> char *toString(const QList<QByteArray> &list)
|
template<> char *toString(const QList<QByteArray> &list)
|
||||||
{
|
{
|
||||||
QByteArray ba = "QList<QByteArray>(";
|
QByteArray ba = "QList<QByteArray>(";
|
||||||
foreach (const QByteArray& item, list) {
|
for (const QByteArray &item : list) {
|
||||||
ba += QTest::toString(item);
|
ba += QTest::toString(item);
|
||||||
ba += ',';
|
ba += ',';
|
||||||
}
|
}
|
||||||
@@ -392,8 +392,8 @@ private slots:
|
|||||||
QByteArray tst_Preprocessor::simplified(const QByteArray &buf)
|
QByteArray tst_Preprocessor::simplified(const QByteArray &buf)
|
||||||
{
|
{
|
||||||
QString out;
|
QString out;
|
||||||
QList<QByteArray> lines = buf.split('\n');
|
const QList<QByteArray> lines = buf.split('\n');
|
||||||
foreach (const QByteArray &line, lines) {
|
for (const QByteArray &line : lines) {
|
||||||
if (!line.startsWith('#')) {
|
if (!line.startsWith('#')) {
|
||||||
out.append(" ");
|
out.append(" ");
|
||||||
out.append(QString::fromUtf8(line));
|
out.append(QString::fromUtf8(line));
|
||||||
|
@@ -140,9 +140,9 @@ void tst_PluginManager::circularPlugins()
|
|||||||
{
|
{
|
||||||
PluginManager::setPluginPaths(QStringList() << pluginFolder(QLatin1String("circularplugins")));
|
PluginManager::setPluginPaths(QStringList() << pluginFolder(QLatin1String("circularplugins")));
|
||||||
PluginManager::loadPlugins();
|
PluginManager::loadPlugins();
|
||||||
QVector<PluginSpec *> plugins = PluginManager::plugins();
|
const QVector<PluginSpec *> plugins = PluginManager::plugins();
|
||||||
QCOMPARE(plugins.count(), 3);
|
QCOMPARE(plugins.count(), 3);
|
||||||
foreach (PluginSpec *spec, plugins) {
|
for (PluginSpec *spec : plugins) {
|
||||||
if (spec->name() == "plugin1") {
|
if (spec->name() == "plugin1") {
|
||||||
QVERIFY(spec->hasError());
|
QVERIFY(spec->hasError());
|
||||||
QCOMPARE(spec->state(), PluginSpec::Resolved);
|
QCOMPARE(spec->state(), PluginSpec::Resolved);
|
||||||
@@ -164,7 +164,8 @@ void tst_PluginManager::correctPlugins1()
|
|||||||
PluginManager::loadPlugins();
|
PluginManager::loadPlugins();
|
||||||
bool specError = false;
|
bool specError = false;
|
||||||
bool runError = false;
|
bool runError = false;
|
||||||
foreach (PluginSpec *spec, PluginManager::plugins()) {
|
const QVector<PluginSpec *> plugins = PluginManager::plugins();
|
||||||
|
for (PluginSpec *spec : plugins) {
|
||||||
if (spec->hasError()) {
|
if (spec->hasError()) {
|
||||||
qDebug() << spec->filePath();
|
qDebug() << spec->filePath();
|
||||||
qDebug() << spec->errorString();
|
qDebug() << spec->errorString();
|
||||||
@@ -177,7 +178,8 @@ void tst_PluginManager::correctPlugins1()
|
|||||||
bool plugin1running = false;
|
bool plugin1running = false;
|
||||||
bool plugin2running = false;
|
bool plugin2running = false;
|
||||||
bool plugin3running = false;
|
bool plugin3running = false;
|
||||||
foreach (QObject *obj, PluginManager::allObjects()) {
|
const QVector<QObject *> objs = PluginManager::allObjects();
|
||||||
|
for (QObject *obj : objs) {
|
||||||
if (obj->objectName() == "MyPlugin1_running")
|
if (obj->objectName() == "MyPlugin1_running")
|
||||||
plugin1running = true;
|
plugin1running = true;
|
||||||
else if (obj->objectName() == "MyPlugin2_running")
|
else if (obj->objectName() == "MyPlugin2_running")
|
||||||
|
@@ -63,11 +63,13 @@ void scanDirectory(const QString &dir)
|
|||||||
|
|
||||||
ImportDependencies *iDeps = snap.importDependencies();
|
ImportDependencies *iDeps = snap.importDependencies();
|
||||||
qDebug() << "libs:";
|
qDebug() << "libs:";
|
||||||
foreach (const ImportKey &importK, iDeps->libraryImports(vCtx))
|
const QSet<ImportKey> imports = iDeps->libraryImports(vCtx);
|
||||||
|
for (const ImportKey &importK : imports)
|
||||||
qDebug() << "libImport: " << importK.toString();
|
qDebug() << "libImport: " << importK.toString();
|
||||||
qDebug() << "qml files:";
|
qDebug() << "qml files:";
|
||||||
foreach (const ImportKey &importK, iDeps->subdirImports(ImportKey(ImportType::Directory, dir),
|
const QSet<ImportKey> importKeys = iDeps->subdirImports(ImportKey(ImportType::Directory, dir),
|
||||||
vCtx))
|
vCtx);
|
||||||
|
for (const ImportKey &importK : importKeys)
|
||||||
qDebug() << importK.toString();
|
qDebug() << importK.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +163,7 @@ void tst_ImportCheck::test_data()
|
|||||||
|
|
||||||
void tst_ImportCheck::test()
|
void tst_ImportCheck::test()
|
||||||
{
|
{
|
||||||
QFETCH(QStringList, paths);
|
QFETCH(const QStringList, paths);
|
||||||
QFETCH(QStringList, expectedLibraries);
|
QFETCH(QStringList, expectedLibraries);
|
||||||
QFETCH(QStringList, expectedFiles);
|
QFETCH(QStringList, expectedFiles);
|
||||||
|
|
||||||
@@ -185,11 +187,13 @@ void tst_ImportCheck::test()
|
|||||||
ImportDependencies *iDeps = snap.importDependencies();
|
ImportDependencies *iDeps = snap.importDependencies();
|
||||||
QStringList detectedLibraries;
|
QStringList detectedLibraries;
|
||||||
QStringList detectedFiles;
|
QStringList detectedFiles;
|
||||||
foreach (const ImportKey &importK, iDeps->libraryImports(vCtx))
|
const QSet<ImportKey> imports = iDeps->libraryImports(vCtx);
|
||||||
|
for (const ImportKey &importK : imports)
|
||||||
detectedLibraries << importK.toString();
|
detectedLibraries << importK.toString();
|
||||||
foreach (const QString &path, paths) {
|
for (const QString &path : paths) {
|
||||||
foreach (const ImportKey &importK, iDeps->subdirImports(ImportKey(ImportType::Directory,
|
const QSet<ImportKey> importKeys
|
||||||
path), vCtx)) {
|
= iDeps->subdirImports(ImportKey(ImportType::Directory, path), vCtx);
|
||||||
|
for (const ImportKey &importK : importKeys) {
|
||||||
detectedFiles << QFileInfo(importK.toString()).canonicalFilePath();
|
detectedFiles << QFileInfo(importK.toString()).canonicalFilePath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,9 +48,9 @@ void tst_TestTrie::testListAll_data()
|
|||||||
|
|
||||||
void tst_TestTrie::testListAll()
|
void tst_TestTrie::testListAll()
|
||||||
{
|
{
|
||||||
QFETCH(QStringList, strs);
|
QFETCH(const QStringList, strs);
|
||||||
Trie trie;
|
Trie trie;
|
||||||
foreach (const QString &s, strs)
|
for (const QString &s : strs)
|
||||||
trie.insert(s);
|
trie.insert(s);
|
||||||
QStringList ref=strs;
|
QStringList ref=strs;
|
||||||
ref.sort();
|
ref.sort();
|
||||||
@@ -61,7 +61,7 @@ void tst_TestTrie::testListAll()
|
|||||||
QDebug dbg = qDebug();
|
QDebug dbg = qDebug();
|
||||||
dbg << "ERROR inserting [";
|
dbg << "ERROR inserting [";
|
||||||
bool comma = false;
|
bool comma = false;
|
||||||
foreach (const QString &s, strs) {
|
for (const QString &s : strs) {
|
||||||
if (comma)
|
if (comma)
|
||||||
dbg << ",";
|
dbg << ",";
|
||||||
else
|
else
|
||||||
@@ -71,7 +71,7 @@ void tst_TestTrie::testListAll()
|
|||||||
dbg << "] one gets " << trie;
|
dbg << "] one gets " << trie;
|
||||||
}
|
}
|
||||||
QCOMPARE(ref, content);
|
QCOMPARE(ref, content);
|
||||||
foreach (const QString &s,strs) {
|
for (const QString &s : strs) {
|
||||||
if (VERBOSE && ! trie.contains(s)) {
|
if (VERBOSE && ! trie.contains(s)) {
|
||||||
qDebug() << "ERROR could not find " << s << "in" << trie;
|
qDebug() << "ERROR could not find " << s << "in" << trie;
|
||||||
}
|
}
|
||||||
@@ -115,13 +115,13 @@ void tst_TestTrie::testMerge_data()
|
|||||||
|
|
||||||
void tst_TestTrie::testMerge()
|
void tst_TestTrie::testMerge()
|
||||||
{
|
{
|
||||||
QFETCH(QStringList, str1);
|
QFETCH(const QStringList, str1);
|
||||||
QFETCH(QStringList, str2);
|
QFETCH(const QStringList, str2);
|
||||||
Trie trie1;
|
Trie trie1;
|
||||||
foreach (const QString &s, str1)
|
for (const QString &s : str1)
|
||||||
trie1.insert(s);
|
trie1.insert(s);
|
||||||
Trie trie2;
|
Trie trie2;
|
||||||
foreach (const QString &s, str2)
|
for (const QString &s : str2)
|
||||||
trie2.insert(s);
|
trie2.insert(s);
|
||||||
QStringList ref=str1;
|
QStringList ref=str1;
|
||||||
ref.append(str2);
|
ref.append(str2);
|
||||||
@@ -134,7 +134,7 @@ void tst_TestTrie::testMerge()
|
|||||||
QDebug dbg=qDebug();
|
QDebug dbg=qDebug();
|
||||||
dbg << "ERROR merging [";
|
dbg << "ERROR merging [";
|
||||||
bool comma = false;
|
bool comma = false;
|
||||||
foreach (const QString &s, str1) {
|
for (const QString &s : str1) {
|
||||||
if (comma)
|
if (comma)
|
||||||
dbg << ",";
|
dbg << ",";
|
||||||
else
|
else
|
||||||
@@ -143,7 +143,7 @@ void tst_TestTrie::testMerge()
|
|||||||
}
|
}
|
||||||
dbg << "] => " << trie1 << " and [";
|
dbg << "] => " << trie1 << " and [";
|
||||||
comma = false;
|
comma = false;
|
||||||
foreach (const QString &s, str2) {
|
for (const QString &s : str2) {
|
||||||
if (comma)
|
if (comma)
|
||||||
dbg << ",";
|
dbg << ",";
|
||||||
else
|
else
|
||||||
@@ -192,30 +192,31 @@ void tst_TestTrie::testIntersect_data()
|
|||||||
|
|
||||||
void tst_TestTrie::testIntersect()
|
void tst_TestTrie::testIntersect()
|
||||||
{
|
{
|
||||||
QFETCH(QStringList, str1);
|
QFETCH(const QStringList, str1);
|
||||||
QFETCH(QStringList, str2);
|
QFETCH(const QStringList, str2);
|
||||||
Trie trie1;
|
Trie trie1;
|
||||||
foreach (const QString &s, str1)
|
for (const QString &s : str1)
|
||||||
trie1.insert(s);
|
trie1.insert(s);
|
||||||
Trie trie2;
|
Trie trie2;
|
||||||
foreach (const QString &s, str2)
|
for (const QString &s : str2)
|
||||||
trie2.insert(s);
|
trie2.insert(s);
|
||||||
QSet<QString> ref1;
|
QSet<QString> ref1;
|
||||||
foreach (const QString &s, str1)
|
for (const QString &s : str1)
|
||||||
ref1.insert(s);
|
ref1.insert(s);
|
||||||
QSet<QString> ref2;
|
QSet<QString> ref2;
|
||||||
foreach (const QString &s, str2)
|
for (const QString &s : str2)
|
||||||
ref2.insert(s);
|
ref2.insert(s);
|
||||||
ref1.intersect(ref2);
|
ref1.intersect(ref2);
|
||||||
Trie trie3 = trie1.intersectF(trie2);
|
Trie trie3 = trie1.intersectF(trie2);
|
||||||
ref2.clear();
|
ref2.clear();
|
||||||
foreach (const QString &s, trie3.stringList())
|
const QStringList str = trie3.stringList();
|
||||||
|
for (const QString &s : str)
|
||||||
ref2.insert(s);
|
ref2.insert(s);
|
||||||
if (VERBOSE && ref1 != ref2) {
|
if (VERBOSE && ref1 != ref2) {
|
||||||
QDebug dbg=qDebug();
|
QDebug dbg=qDebug();
|
||||||
dbg << "ERROR intersecting [";
|
dbg << "ERROR intersecting [";
|
||||||
bool comma = false;
|
bool comma = false;
|
||||||
foreach (const QString &s, str1) {
|
for (const QString &s : str1) {
|
||||||
if (comma)
|
if (comma)
|
||||||
dbg << ",";
|
dbg << ",";
|
||||||
else
|
else
|
||||||
@@ -224,7 +225,7 @@ void tst_TestTrie::testIntersect()
|
|||||||
}
|
}
|
||||||
dbg << "] => " << trie1 << " and [";
|
dbg << "] => " << trie1 << " and [";
|
||||||
comma = false;
|
comma = false;
|
||||||
foreach (const QString &s, str2) {
|
for (const QString &s : str2) {
|
||||||
if (comma)
|
if (comma)
|
||||||
dbg << ",";
|
dbg << ",";
|
||||||
else
|
else
|
||||||
@@ -275,14 +276,15 @@ void tst_TestTrie::testCompletion_data()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_TestTrie::testCompletion() {
|
void tst_TestTrie::testCompletion()
|
||||||
QFETCH(QStringList, trieContents);
|
{
|
||||||
|
QFETCH(const QStringList, trieContents);
|
||||||
QFETCH(QString, str);
|
QFETCH(QString, str);
|
||||||
QFETCH(QStringList, completions);
|
QFETCH(const QStringList, completions);
|
||||||
QFETCH(int, flags);
|
QFETCH(int, flags);
|
||||||
|
|
||||||
Trie trie;
|
Trie trie;
|
||||||
foreach (const QString &s, trieContents)
|
for (const QString &s : trieContents)
|
||||||
trie.insert(s);
|
trie.insert(s);
|
||||||
QStringList res = trie.complete(str, QString(), LookupFlags(flags));
|
QStringList res = trie.complete(str, QString(), LookupFlags(flags));
|
||||||
res = matchStrengthSort(str, res);
|
res = matchStrengthSort(str, res);
|
||||||
@@ -290,11 +292,11 @@ void tst_TestTrie::testCompletion() {
|
|||||||
qDebug() << "unexpected completions for " << str
|
qDebug() << "unexpected completions for " << str
|
||||||
<< " in " << trie;
|
<< " in " << trie;
|
||||||
qDebug() << "expected :[";
|
qDebug() << "expected :[";
|
||||||
foreach (const QString &s, completions) {
|
for (const QString &s : completions) {
|
||||||
qDebug() << s;
|
qDebug() << s;
|
||||||
}
|
}
|
||||||
qDebug() << "] got [";
|
qDebug() << "] got [";
|
||||||
foreach (const QString &s, res) {
|
for (const QString &s : std::as_const(res)) {
|
||||||
qDebug() << s;
|
qDebug() << s;
|
||||||
}
|
}
|
||||||
qDebug() << "]";
|
qDebug() << "]";
|
||||||
@@ -323,7 +325,7 @@ void interactiveCompletionTester(){
|
|||||||
LookupFlags(CaseInsensitive|SkipChars|SkipSpaces));
|
LookupFlags(CaseInsensitive|SkipChars|SkipSpaces));
|
||||||
res = matchStrengthSort(line,res);
|
res = matchStrengthSort(line,res);
|
||||||
qDebug() << "possible completions:[";
|
qDebug() << "possible completions:[";
|
||||||
foreach (const QString &s, res) {
|
for (const QString &s : std::as_const(res)) {
|
||||||
qDebug() << matchStrength(line,s) << " " << s;
|
qDebug() << matchStrength(line,s) << " " << s;
|
||||||
}
|
}
|
||||||
qDebug() << "]";
|
qDebug() << "]";
|
||||||
|
@@ -12,7 +12,8 @@ using namespace QmlDesigner::Internal;
|
|||||||
|
|
||||||
bool TestModelToTextMerger::isNodeScheduledForRemoval(const ModelNode &node) const
|
bool TestModelToTextMerger::isNodeScheduledForRemoval(const ModelNode &node) const
|
||||||
{
|
{
|
||||||
foreach (RewriteAction *action, scheduledRewriteActions()) {
|
const QList<RewriteAction *> actions = scheduledRewriteActions();
|
||||||
|
for (RewriteAction *action : actions) {
|
||||||
if (RemoveNodeRewriteAction *removeAction = action->asRemoveNodeRewriteAction()) {
|
if (RemoveNodeRewriteAction *removeAction = action->asRemoveNodeRewriteAction()) {
|
||||||
if (removeAction->node() == node)
|
if (removeAction->node() == node)
|
||||||
return true;
|
return true;
|
||||||
@@ -24,7 +25,8 @@ bool TestModelToTextMerger::isNodeScheduledForRemoval(const ModelNode &node) con
|
|||||||
|
|
||||||
bool TestModelToTextMerger::isNodeScheduledForAddition(const ModelNode &node) const
|
bool TestModelToTextMerger::isNodeScheduledForAddition(const ModelNode &node) const
|
||||||
{
|
{
|
||||||
foreach (RewriteAction *action, scheduledRewriteActions()) {
|
const QList<RewriteAction *> actions = scheduledRewriteActions();
|
||||||
|
for (RewriteAction *action : actions) {
|
||||||
if (AddPropertyRewriteAction *addPropertyAction = action->asAddPropertyRewriteAction()) {
|
if (AddPropertyRewriteAction *addPropertyAction = action->asAddPropertyRewriteAction()) {
|
||||||
const AbstractProperty property = addPropertyAction->property();
|
const AbstractProperty property = addPropertyAction->property();
|
||||||
if (property.isNodeProperty() && property.toNodeProperty().modelNode() == node)
|
if (property.isNodeProperty() && property.toNodeProperty().modelNode() == node)
|
||||||
@@ -46,7 +48,8 @@ bool TestModelToTextMerger::isNodeScheduledForAddition(const ModelNode &node) co
|
|||||||
|
|
||||||
VariantProperty TestModelToTextMerger::findAddedVariantProperty(const VariantProperty &property) const
|
VariantProperty TestModelToTextMerger::findAddedVariantProperty(const VariantProperty &property) const
|
||||||
{
|
{
|
||||||
foreach (RewriteAction *action, scheduledRewriteActions()) {
|
const QList<RewriteAction *> actions = scheduledRewriteActions();
|
||||||
|
for (RewriteAction *action : actions) {
|
||||||
if (AddPropertyRewriteAction *addPropertyAction = action->asAddPropertyRewriteAction()) {
|
if (AddPropertyRewriteAction *addPropertyAction = action->asAddPropertyRewriteAction()) {
|
||||||
const AbstractProperty candidate = addPropertyAction->property();
|
const AbstractProperty candidate = addPropertyAction->property();
|
||||||
|
|
||||||
|
@@ -119,7 +119,7 @@ static void initializeMetaTypeSystem(const QString &resourcePath)
|
|||||||
|
|
||||||
QStringList errorsAndWarnings;
|
QStringList errorsAndWarnings;
|
||||||
QmlJS::CppQmlTypesLoader::loadQmlTypes(qmlFiles, &errorsAndWarnings, &errorsAndWarnings);
|
QmlJS::CppQmlTypesLoader::loadQmlTypes(qmlFiles, &errorsAndWarnings, &errorsAndWarnings);
|
||||||
foreach (const QString &errorAndWarning, errorsAndWarnings)
|
for (const QString &errorAndWarning : std::as_const(errorsAndWarnings))
|
||||||
qWarning() << qPrintable(errorAndWarning);
|
qWarning() << qPrintable(errorAndWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ void TestView::fileUrlChanged(const QUrl & oldBaseUrl, const QUrl &newBaseUrl)
|
|||||||
void TestView::propertiesAboutToBeRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList)
|
void TestView::propertiesAboutToBeRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList)
|
||||||
{
|
{
|
||||||
QStringList propertyNames;
|
QStringList propertyNames;
|
||||||
foreach (const QmlDesigner::AbstractProperty &property, propertyList)
|
for (const QmlDesigner::AbstractProperty &property : propertyList)
|
||||||
propertyNames += QString::fromUtf8(property.name());
|
propertyNames += QString::fromUtf8(property.name());
|
||||||
m_methodCalls += MethodCall("propertiesAboutToBeRemoved", QStringList() << propertyNames.join(", "));
|
m_methodCalls += MethodCall("propertiesAboutToBeRemoved", QStringList() << propertyNames.join(", "));
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ void TestView::propertiesAboutToBeRemoved(const QList<QmlDesigner::AbstractPrope
|
|||||||
void TestView::propertiesRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList)
|
void TestView::propertiesRemoved(const QList<QmlDesigner::AbstractProperty> &propertyList)
|
||||||
{
|
{
|
||||||
QStringList propertyNames;
|
QStringList propertyNames;
|
||||||
foreach (const QmlDesigner::AbstractProperty &property, propertyList)
|
for (const QmlDesigner::AbstractProperty &property : propertyList)
|
||||||
propertyNames += QString::fromUtf8(property.name());
|
propertyNames += QString::fromUtf8(property.name());
|
||||||
m_methodCalls += MethodCall("propertiesRemoved", QStringList() << propertyNames.join(", "));
|
m_methodCalls += MethodCall("propertiesRemoved", QStringList() << propertyNames.join(", "));
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ void TestView::propertiesRemoved(const QList<QmlDesigner::AbstractProperty> &pro
|
|||||||
void TestView::signalHandlerPropertiesChanged(const QVector<QmlDesigner::SignalHandlerProperty> &propertyList, PropertyChangeFlags)
|
void TestView::signalHandlerPropertiesChanged(const QVector<QmlDesigner::SignalHandlerProperty> &propertyList, PropertyChangeFlags)
|
||||||
{
|
{
|
||||||
QStringList propertyNames;
|
QStringList propertyNames;
|
||||||
foreach (const QmlDesigner::AbstractProperty &property, propertyList)
|
for (const QmlDesigner::AbstractProperty &property : propertyList)
|
||||||
propertyNames += QString::fromUtf8(property.name());
|
propertyNames += QString::fromUtf8(property.name());
|
||||||
m_methodCalls += MethodCall("signalHandlerPropertiesChanged", QStringList() << propertyNames.join(", "));
|
m_methodCalls += MethodCall("signalHandlerPropertiesChanged", QStringList() << propertyNames.join(", "));
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ void TestView::nodeAboutToBeReparented(const QmlDesigner::ModelNode &node, const
|
|||||||
void TestView::bindingPropertiesChanged(const QList<QmlDesigner::BindingProperty> &propertyList, PropertyChangeFlags propertyChange)
|
void TestView::bindingPropertiesChanged(const QList<QmlDesigner::BindingProperty> &propertyList, PropertyChangeFlags propertyChange)
|
||||||
{
|
{
|
||||||
QStringList propertyNames;
|
QStringList propertyNames;
|
||||||
foreach (const QmlDesigner::BindingProperty &property, propertyList)
|
for (const QmlDesigner::BindingProperty &property : propertyList)
|
||||||
propertyNames += QString::fromUtf8(property.name());
|
propertyNames += QString::fromUtf8(property.name());
|
||||||
m_methodCalls += MethodCall("bindingPropertiesChanged", QStringList() << propertyNames.join(", ") << serialize(propertyChange));
|
m_methodCalls += MethodCall("bindingPropertiesChanged", QStringList() << propertyNames.join(", ") << serialize(propertyChange));
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ void TestView::bindingPropertiesChanged(const QList<QmlDesigner::BindingProperty
|
|||||||
void TestView::variantPropertiesChanged(const QList<QmlDesigner::VariantProperty> &propertyList, PropertyChangeFlags propertyChange)
|
void TestView::variantPropertiesChanged(const QList<QmlDesigner::VariantProperty> &propertyList, PropertyChangeFlags propertyChange)
|
||||||
{
|
{
|
||||||
QStringList propertyNames;
|
QStringList propertyNames;
|
||||||
foreach (const QmlDesigner::VariantProperty &property, propertyList)
|
for (const QmlDesigner::VariantProperty &property : propertyList)
|
||||||
propertyNames += QString::fromUtf8(property.name());
|
propertyNames += QString::fromUtf8(property.name());
|
||||||
|
|
||||||
m_methodCalls += MethodCall("variantPropertiesChanged", QStringList() << propertyNames.join(", ") << serialize(propertyChange));
|
m_methodCalls += MethodCall("variantPropertiesChanged", QStringList() << propertyNames.join(", ") << serialize(propertyChange));
|
||||||
@@ -124,10 +124,10 @@ void TestView::selectedNodesChanged(const QList<QmlDesigner::ModelNode> &selecte
|
|||||||
const QList<QmlDesigner::ModelNode> &lastSelectedNodeList)
|
const QList<QmlDesigner::ModelNode> &lastSelectedNodeList)
|
||||||
{
|
{
|
||||||
QStringList selectedNodes;
|
QStringList selectedNodes;
|
||||||
foreach (const QmlDesigner::ModelNode &node, selectedNodeList)
|
for (const QmlDesigner::ModelNode &node : selectedNodeList)
|
||||||
selectedNodes += node.id();
|
selectedNodes += node.id();
|
||||||
QStringList lastSelectedNodes;
|
QStringList lastSelectedNodes;
|
||||||
foreach (const QmlDesigner::ModelNode &node, lastSelectedNodeList)
|
for (const QmlDesigner::ModelNode &node : lastSelectedNodeList)
|
||||||
lastSelectedNodes += node.id();
|
lastSelectedNodes += node.id();
|
||||||
m_methodCalls += MethodCall("selectedNodesChanged", QStringList() << selectedNodes.join(", ") << lastSelectedNodes.join(", "));
|
m_methodCalls += MethodCall("selectedNodesChanged", QStringList() << selectedNodes.join(", ") << lastSelectedNodes.join(", "));
|
||||||
}
|
}
|
||||||
|
@@ -108,17 +108,17 @@ struct Line {
|
|||||||
int expectedIndent;
|
int expectedIndent;
|
||||||
};
|
};
|
||||||
|
|
||||||
QString concatLines(QList<Line> lines)
|
QString concatLines(const QList<Line> &lines)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
foreach (const Line &l, lines) {
|
for (const Line &l : lines) {
|
||||||
result += l.line;
|
result += l.line;
|
||||||
result += "\n";
|
result += "\n";
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIndent(QList<Line> data, int style = 0)
|
void checkIndent(const QList<Line> &data, int style = 0)
|
||||||
{
|
{
|
||||||
Q_UNUSED(style)
|
Q_UNUSED(style)
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ void checkIndent(QList<Line> data, int style = 0)
|
|||||||
CreatorCodeFormatter formatter;
|
CreatorCodeFormatter formatter;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (const Line &l, data) {
|
for (const Line &l : data) {
|
||||||
QTextBlock b = document.findBlockByLineNumber(i);
|
QTextBlock b = document.findBlockByLineNumber(i);
|
||||||
if (l.expectedIndent != DontCheck) {
|
if (l.expectedIndent != DontCheck) {
|
||||||
int actualIndent = formatter.indentFor(b);
|
int actualIndent = formatter.indentFor(b);
|
||||||
|
@@ -51,7 +51,8 @@ QStringList tst_QrcParser::allPaths(QrcParser::ConstPtr p)
|
|||||||
continue;
|
continue;
|
||||||
QMap<QString,QStringList> content;
|
QMap<QString,QStringList> content;
|
||||||
p->collectFilesInPath(pAtt, &content, true);
|
p->collectFilesInPath(pAtt, &content, true);
|
||||||
foreach (const QString &fileName, content.keys())
|
const QStringList fileNames = content.keys();
|
||||||
|
for (const QString &fileName : fileNames)
|
||||||
res.append(pAtt+fileName);
|
res.append(pAtt+fileName);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@@ -61,7 +62,8 @@ void tst_QrcParser::firstAtTest()
|
|||||||
{
|
{
|
||||||
QFETCH(QString, path);
|
QFETCH(QString, path);
|
||||||
QrcParser::Ptr p = QrcParser::parseQrcFile(path, QString());
|
QrcParser::Ptr p = QrcParser::parseQrcFile(path, QString());
|
||||||
foreach (const QString &qrcPath, allPaths(p)) {
|
const QStringList paths = allPaths(p);
|
||||||
|
for (const QString &qrcPath : paths) {
|
||||||
QString s1 = p->firstFileAtPath(qrcPath, m_locale);
|
QString s1 = p->firstFileAtPath(qrcPath, m_locale);
|
||||||
if (s1.isEmpty())
|
if (s1.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
@@ -78,27 +80,30 @@ void tst_QrcParser::firstInTest()
|
|||||||
{
|
{
|
||||||
QFETCH(QString, path);
|
QFETCH(QString, path);
|
||||||
QrcParser::Ptr p = QrcParser::parseQrcFile(path, QString());
|
QrcParser::Ptr p = QrcParser::parseQrcFile(path, QString());
|
||||||
foreach (const QString &qrcPath, allPaths(p)) {
|
const QStringList paths = allPaths(p);
|
||||||
|
for (const QString &qrcPath : paths) {
|
||||||
if (!qrcPath.endsWith(QLatin1Char('/')))
|
if (!qrcPath.endsWith(QLatin1Char('/')))
|
||||||
continue;
|
continue;
|
||||||
for (int addDirs = 0; addDirs < 2; ++addDirs) {
|
for (int addDirs = 0; addDirs < 2; ++addDirs) {
|
||||||
QMap<QString,QStringList> s1;
|
QMap<QString,QStringList> s1;
|
||||||
p->collectFilesInPath(qrcPath, &s1, addDirs, &m_locale);
|
p->collectFilesInPath(qrcPath, &s1, addDirs, &m_locale);
|
||||||
foreach (const QString &k, s1.keys()) {
|
const QStringList keys = s1.keys();
|
||||||
|
for (const QString &k : keys) {
|
||||||
if (!k.endsWith(QLatin1Char('/'))) {
|
if (!k.endsWith(QLatin1Char('/'))) {
|
||||||
QCOMPARE(s1.value(k).value(0), p->firstFileAtPath(qrcPath + k, m_locale));
|
QCOMPARE(s1.value(k).value(0), p->firstFileAtPath(qrcPath + k, m_locale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMap<QString,QStringList> s2;
|
QMap<QString,QStringList> s2;
|
||||||
p->collectFilesInPath(qrcPath, &s2, addDirs);
|
p->collectFilesInPath(qrcPath, &s2, addDirs);
|
||||||
foreach (const QString &k, s1.keys()) {
|
for (const QString &k : keys) {
|
||||||
if (!k.endsWith(QLatin1Char('/'))) {
|
if (!k.endsWith(QLatin1Char('/'))) {
|
||||||
QVERIFY(s2.value(k).contains(s1.value(k).at(0)));
|
QVERIFY(s2.value(k).contains(s1.value(k).at(0)));
|
||||||
} else {
|
} else {
|
||||||
QVERIFY(s2.contains(k));
|
QVERIFY(s2.contains(k));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (const QString &k, s2.keys()) {
|
const QStringList keys2 = s2.keys();
|
||||||
|
for (const QString &k : keys2) {
|
||||||
if (!k.endsWith(QLatin1Char('/'))) {
|
if (!k.endsWith(QLatin1Char('/'))) {
|
||||||
QStringList l;
|
QStringList l;
|
||||||
p->collectFilesAtPath(qrcPath + k, &l);
|
p->collectFilesAtPath(qrcPath + k, &l);
|
||||||
|
@@ -84,7 +84,8 @@ void tst_FlameGraph::testRebuild()
|
|||||||
QCOMPARE(flameGraph.depth(), 3);
|
QCOMPARE(flameGraph.depth(), 3);
|
||||||
qreal i = 0;
|
qreal i = 0;
|
||||||
qreal position = 0;
|
qreal position = 0;
|
||||||
foreach (QQuickItem *child, flameGraph.childItems()) {
|
const QList<QQuickItem *> children = flameGraph.childItems();
|
||||||
|
for (QQuickItem *child : children) {
|
||||||
FlameGraph::FlameGraphAttached *attached =
|
FlameGraph::FlameGraphAttached *attached =
|
||||||
FlameGraph::FlameGraph::qmlAttachedProperties(child);
|
FlameGraph::FlameGraph::qmlAttachedProperties(child);
|
||||||
QVERIFY(attached);
|
QVERIFY(attached);
|
||||||
@@ -94,7 +95,8 @@ void tst_FlameGraph::testRebuild()
|
|||||||
QVERIFY(attached->isDataValid());
|
QVERIFY(attached->isDataValid());
|
||||||
|
|
||||||
qreal j = 0;
|
qreal j = 0;
|
||||||
foreach (QQuickItem *grandchild, child->childItems()) {
|
const QList<QQuickItem *> grandchildren = child->childItems();
|
||||||
|
for (QQuickItem *grandchild : grandchildren) {
|
||||||
FlameGraph::FlameGraphAttached *attached2 =
|
FlameGraph::FlameGraphAttached *attached2 =
|
||||||
FlameGraph::FlameGraph::qmlAttachedProperties(grandchild);
|
FlameGraph::FlameGraph::qmlAttachedProperties(grandchild);
|
||||||
QVERIFY(attached2);
|
QVERIFY(attached2);
|
||||||
|
@@ -335,7 +335,7 @@ void CallgrindParserTests::testMultiPosAndCost()
|
|||||||
|
|
||||||
const Function *findFunction(const QString &needle, const QVector<const Function *> &haystack)
|
const Function *findFunction(const QString &needle, const QVector<const Function *> &haystack)
|
||||||
{
|
{
|
||||||
foreach (const Function *function, haystack) {
|
for (const Function *function : haystack) {
|
||||||
if (function->name() == needle) {
|
if (function->name() == needle) {
|
||||||
return function;
|
return function;
|
||||||
}
|
}
|
||||||
|
@@ -117,11 +117,13 @@ void ModelTestWidget::showViewContextMenu(const QPoint &pos)
|
|||||||
const int columns = data->events().size() + data->positions().size() + 2;
|
const int columns = data->events().size() + data->positions().size() + 2;
|
||||||
QStandardItemModel *model = new QStandardItemModel(rows, columns, view);
|
QStandardItemModel *model = new QStandardItemModel(rows, columns, view);
|
||||||
int headerColumn = 0;
|
int headerColumn = 0;
|
||||||
foreach (const QString &event, data->events()) {
|
const QStringList events = data->events();
|
||||||
|
for (const QString &event : events) {
|
||||||
model->setHeaderData(headerColumn++, Qt::Horizontal, event);
|
model->setHeaderData(headerColumn++, Qt::Horizontal, event);
|
||||||
}
|
}
|
||||||
const int lastEventColumn = headerColumn;
|
const int lastEventColumn = headerColumn;
|
||||||
foreach (const QString &pos, data->positions()) {
|
const QStringList positions = data->positions();
|
||||||
|
for (const QString &pos : positions) {
|
||||||
model->setHeaderData(headerColumn++, Qt::Horizontal, pos);
|
model->setHeaderData(headerColumn++, Qt::Horizontal, pos);
|
||||||
}
|
}
|
||||||
const int lastPosColumn = headerColumn;
|
const int lastPosColumn = headerColumn;
|
||||||
|
@@ -22,7 +22,8 @@ bool MyPlugin1::initialize(const QStringList & /*arguments*/, QString *errorStri
|
|||||||
|
|
||||||
bool found2 = false;
|
bool found2 = false;
|
||||||
bool found3 = false;
|
bool found3 = false;
|
||||||
foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
|
const QList<QObject *> objects = ExtensionSystem::PluginManager::instance()->allObjects();
|
||||||
|
for (QObject *object : objects) {
|
||||||
if (object->objectName() == "MyPlugin2")
|
if (object->objectName() == "MyPlugin2")
|
||||||
found2 = true;
|
found2 = true;
|
||||||
else if (object->objectName() == "MyPlugin3")
|
else if (object->objectName() == "MyPlugin3")
|
||||||
|
@@ -21,7 +21,8 @@ bool MyPlugin3::initialize(const QStringList & /*arguments*/, QString *errorStri
|
|||||||
ExtensionSystem::PluginManager::addObject(object1);
|
ExtensionSystem::PluginManager::addObject(object1);
|
||||||
|
|
||||||
bool found2 = false;
|
bool found2 = false;
|
||||||
foreach (QObject *object, ExtensionSystem::PluginManager::allObjects()) {
|
const QList<QObject *> objects = ExtensionSystem::PluginManager::allObjects();
|
||||||
|
for (QObject *object : objects) {
|
||||||
if (object->objectName() == "MyPlugin2")
|
if (object->objectName() == "MyPlugin2")
|
||||||
found2 = true;
|
found2 = true;
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ static int evaluate(const QString &fileName, const QString &in_pwd, const QStrin
|
|||||||
if (visitor.templateType() == ProFileEvaluator::TT_Subdirs) {
|
if (visitor.templateType() == ProFileEvaluator::TT_Subdirs) {
|
||||||
QStringList subdirs = visitor.values(QLatin1String("SUBDIRS"));
|
QStringList subdirs = visitor.values(QLatin1String("SUBDIRS"));
|
||||||
subdirs.removeDuplicates();
|
subdirs.removeDuplicates();
|
||||||
foreach (const QString &subDirVar, subdirs) {
|
for (const QString &subDirVar : std::as_const(subdirs)) {
|
||||||
QString realDir;
|
QString realDir;
|
||||||
const QString subDirKey = subDirVar + QLatin1String(".subdir");
|
const QString subDirKey = subDirVar + QLatin1String(".subdir");
|
||||||
const QString subDirFileKey = subDirVar + QLatin1String(".file");
|
const QString subDirFileKey = subDirVar + QLatin1String(".file");
|
||||||
|
@@ -126,7 +126,7 @@ void tst_CodeSize::cleanup()
|
|||||||
|
|
||||||
void tst_CodeSize::codesize()
|
void tst_CodeSize::codesize()
|
||||||
{
|
{
|
||||||
QFETCH(Suite, suite);
|
QFETCH(const Suite, suite);
|
||||||
static int suiteCount = 0;
|
static int suiteCount = 0;
|
||||||
++suiteCount;
|
++suiteCount;
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ void tst_CodeSize::codesize()
|
|||||||
"}\n");
|
"}\n");
|
||||||
mainCpp.close();
|
mainCpp.close();
|
||||||
|
|
||||||
foreach (const Case &c, suite.cases) {
|
for (const Case &c : suite.cases) {
|
||||||
QByteArray caseProName = c.file + ".pro";
|
QByteArray caseProName = c.file + ".pro";
|
||||||
bigPro.write("\nSUBDIRS += " + caseProName);
|
bigPro.write("\nSUBDIRS += " + caseProName);
|
||||||
mainPro.write("\nLIBS += -l" + c.file);
|
mainPro.write("\nLIBS += -l" + c.file);
|
||||||
@@ -223,7 +223,7 @@ void tst_CodeSize::codesize()
|
|||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (const Case &c, suite.cases) {
|
for (const Case &c : std::as_const(suite.cases)) {
|
||||||
++i;
|
++i;
|
||||||
cout << "\n\n===================== VARIANT " << suiteCount << '.' << i << ' '
|
cout << "\n\n===================== VARIANT " << suiteCount << '.' << i << ' '
|
||||||
<< " ================================"
|
<< " ================================"
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
typedef QPair<QByteArray, QByteArray> Pair;
|
typedef QPair<QByteArray, QByteArray> Pair;
|
||||||
|
|
||||||
foreach (const Pair &conn, _connections)
|
for (const Pair &conn : std::as_const(_connections))
|
||||||
out << conn.first.constData() << " -> " << conn.second.constData() << endl;
|
out << conn.first.constData() << " -> " << conn.second.constData() << endl;
|
||||||
|
|
||||||
alignTerminals();
|
alignTerminals();
|
||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void alignTerminals() {
|
void alignTerminals() {
|
||||||
out<<"{ rank=same;" << endl;
|
out<<"{ rank=same;" << endl;
|
||||||
foreach (const QByteArray &terminalShape, _terminalShapes) {
|
for (const QByteArray &terminalShape : std::as_const(_terminalShapes)) {
|
||||||
out << " " << string(terminalShape.constData(), terminalShape.size()).c_str() << ";" << endl;
|
out << " " << string(terminalShape.constData(), terminalShape.size()).c_str() << ";" << endl;
|
||||||
}
|
}
|
||||||
out<<"}"<<endl;
|
out<<"}"<<endl;
|
||||||
@@ -296,7 +296,7 @@ int main(int argc, char *argv[])
|
|||||||
QStringList files = app.arguments();
|
QStringList files = app.arguments();
|
||||||
files.removeFirst();
|
files.removeFirst();
|
||||||
|
|
||||||
foreach (const QString &fileName, files) {
|
for (const QString &fileName : std::as_const(files)) {
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
if (! file.open(QFile::ReadOnly)) {
|
if (! file.open(QFile::ReadOnly)) {
|
||||||
cerr << "Cannot open \"" << qPrintable(fileName)
|
cerr << "Cannot open \"" << qPrintable(fileName)
|
||||||
@@ -311,7 +311,8 @@ int main(int argc, char *argv[])
|
|||||||
doc->setSource(QString::fromUtf8(source));
|
doc->setSource(QString::fromUtf8(source));
|
||||||
doc->parse();
|
doc->parse();
|
||||||
|
|
||||||
foreach (const DiagnosticMessage &m, doc->diagnosticMessages()) {
|
const QList<DiagnosticMessage> messages = doc->diagnosticMessages();
|
||||||
|
for (const DiagnosticMessage &m : messages) {
|
||||||
ostream *os;
|
ostream *os;
|
||||||
if (m.isError()) {
|
if (m.isError()) {
|
||||||
os = &cerr;
|
os = &cerr;
|
||||||
|
Reference in New Issue
Block a user