Skip to content
Snippets Groups Projects

QDS-14390 Ignore comment lines in the qmlproject file

Merged Burak Hançerli requested to merge QDS-14390/ignore-comments into master
2 files
+ 5
3
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 4
2
@@ -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.";
}
Loading