forked from qt-creator/qt-creator
QmlDesigner: Add setting for Qt 6 projects
Adding 'qt6Project: true' to the qmlproject file marks the project as Qt 6 'only'. Task-number: QDS-4734 Change-Id: Ib9d969fd11d409e280734f9bedf759b40470fc61 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -105,6 +105,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
|
||||
if (qtForMCUProperty.isValid() && qtForMCUProperty.toBool())
|
||||
projectItem->setQtForMCUs(qtForMCUProperty.toBool());
|
||||
|
||||
const QVariant qt6ProjectProperty = rootNode->property("qt6Project");
|
||||
if (qt6ProjectProperty.isValid() && qt6ProjectProperty.toBool())
|
||||
projectItem->setQt6Project(qt6ProjectProperty.toBool());
|
||||
|
||||
if (debug)
|
||||
qDebug() << "importPath:" << importPathsProperty << "mainFile:" << mainFileProperty;
|
||||
|
||||
|
||||
@@ -60,6 +60,11 @@ void QmlProjectItem::setQtForMCUs(bool b)
|
||||
m_qtForMCUs = b;
|
||||
}
|
||||
|
||||
void QmlProjectItem::setQt6Project(bool qt6Project)
|
||||
{
|
||||
m_qt6Project = qt6Project;
|
||||
}
|
||||
|
||||
void QmlProjectItem::setImportPaths(const QStringList &importPaths)
|
||||
{
|
||||
if (m_importPaths != importPaths)
|
||||
|
||||
@@ -54,6 +54,9 @@ public:
|
||||
bool qtForMCUs() const { return m_qtForMCUs; }
|
||||
void setQtForMCUs(bool qtForMCUs);
|
||||
|
||||
bool qt6Project() const { return m_qt6Project; }
|
||||
void setQt6Project(bool qt6Project);
|
||||
|
||||
QStringList importPaths() const { return m_importPaths; }
|
||||
void setImportPaths(const QStringList &paths);
|
||||
|
||||
@@ -87,6 +90,7 @@ protected:
|
||||
QVector<QmlProjectContentItem *> m_content; // content property
|
||||
bool m_forceFreeType = false;
|
||||
bool m_qtForMCUs = false;
|
||||
bool m_qt6Project = false;
|
||||
};
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
@@ -272,6 +272,13 @@ bool QmlBuildSystem::qtForMCUs() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QmlBuildSystem::qt6Project() const
|
||||
{
|
||||
if (m_projectItem)
|
||||
return m_projectItem.data()->qt6Project();
|
||||
return false;
|
||||
}
|
||||
|
||||
void QmlBuildSystem::setMainFile(const QString &mainFilePath)
|
||||
{
|
||||
if (m_projectItem)
|
||||
@@ -466,6 +473,8 @@ QVariant QmlBuildSystem::additionalData(Id id) const
|
||||
return forceFreeType();
|
||||
if (id == Constants::customQtForMCUs)
|
||||
return qtForMCUs();
|
||||
if (id == Constants::customQt6Project)
|
||||
return qt6Project();
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
Utils::FilePath mainFilePath() const;
|
||||
|
||||
bool qtForMCUs() const;
|
||||
bool qt6Project() const;
|
||||
void setMainFile(const QString &mainFilePath);
|
||||
Utils::FilePath targetDirectory() const;
|
||||
Utils::FilePath targetFile(const Utils::FilePath &sourceFile) const;
|
||||
|
||||
@@ -34,6 +34,7 @@ const char * const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMET
|
||||
const char customFileSelectorsData[] = "CustomFileSelectorsData";
|
||||
const char customForceFreeTypeData[] = "CustomForceFreeType";
|
||||
const char customQtForMCUs[] = "CustomQtForMCUs";
|
||||
const char customQt6Project[] = "CustomQt6Project";
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
Reference in New Issue
Block a user