diff --git a/qtquickdesigner-components b/qtquickdesigner-components index 20397e26370ff073125fd19f77c7ad013276b5bd..04a5f670d3e7ae28e54bf194a3dd70e13d05ffc4 160000 --- a/qtquickdesigner-components +++ b/qtquickdesigner-components @@ -1 +1 @@ -Subproject commit 20397e26370ff073125fd19f77c7ad013276b5bd +Subproject commit 04a5f670d3e7ae28e54bf194a3dd70e13d05ffc4 diff --git a/src/designviewer.cpp b/src/designviewer.cpp index 4c1a9e88302a95fe39277b5c93c0ebd6f8742ee8..c15a6d1fcdc4d31412314aba42560d06f8a387e4 100644 --- a/src/designviewer.cpp +++ b/src/designviewer.cpp @@ -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."; }