QmlDesigner: Add DesignDocument::projectFolder()

Change-Id: I00aaac58af0f6ce7a6e6504406745a6416663993
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2021-06-10 16:45:25 +02:00
parent eed82176b2
commit 0bdafc56b0
2 changed files with 11 additions and 0 deletions

View File

@@ -279,6 +279,15 @@ bool DesignDocument::isQtForMCUsProject() const
return false;
}
Utils::FilePath DesignDocument::projectFolder() const
{
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName());
if (currentProject)
return currentProject->projectDirectory();
return {};
}
void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textModifer)
{
m_inFileComponentTextModifier.reset(textModifer);

View File

@@ -100,6 +100,8 @@ public:
bool isQtForMCUsProject() const;
Utils::FilePath projectFolder() const;
signals:
void displayNameChanged(const QString &newFileName);
void dirtyStateChanged(bool newState);