Skip to content
Snippets Groups Projects
Commit d5ff6cfb authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

QDS-14390 Ignore comment lines in the qmlproject file

parent 75d743b7
No related branches found
No related tags found
1 merge request!37QDS-14390 Ignore comment lines in the qmlproject file
Pipeline #78313 passed
Subproject commit 20397e26370ff073125fd19f77c7ad013276b5bd
Subproject commit 04a5f670d3e7ae28e54bf194a3dd70e13d05ffc4
......@@ -112,7 +112,9 @@ void DesignViewer::parseQmlprojectFile(const QString &fileName,
return;
}
const QString text = QString::fromUtf8(file.readAll());
// Regular expression to remove lines starting with //
QRegularExpression commentRegExp("^\\s*//.*$", QRegularExpression::MultilineOption);
const QString text = QString::fromUtf8(file.readAll()).remove(commentRegExp);
const QRegularExpression mainFileRegExp("mainFile:\\s*\"(.*)\"");
const QRegularExpressionMatch mainFileMatch = mainFileRegExp.match(text);
......@@ -133,7 +135,7 @@ void DesignViewer::parseQmlprojectFile(const QString &fileName,
const QRegularExpressionMatch qt6ProjectMatch = qt6ProjectRegExp.match(text);
if (!qt6ProjectMatch.hasMatch())
{
qWarning() << "This is not a Qt6 project.\nQt5 projects might work, but they are not "
qWarning() << "This is not a Qt6 project.Qt5 projects might work, but they are not "
"officially supported.";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment