FilePath: Remove ::toDir() and deprecation hints

Change-Id: Ib561c019e3fd44cd85504ad4286eb3759ce19516
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-07-28 15:59:52 +02:00
parent 783f0e1205
commit 451d02c88d
14 changed files with 101 additions and 106 deletions

View File

@@ -289,9 +289,8 @@ bool QmlBuildSystem::setFileSettingInProjectFile(const QString &setting, const U
const QString settingQmlCode = setting + ":";
QDir projectDir = project()->projectFilePath().toDir();
projectDir.cdUp();
const QString relativePath = projectDir.relativeFilePath(mainFilePath.toString());
const Utils::FilePath projectDir = project()->projectFilePath().parentDir();
const QString relativePath = mainFilePath.relativeChildPath(projectDir).path();
if (fileContent.indexOf(settingQmlCode) < 0) {
QString addedText = QString("\n %1 \"%2\"\n").arg(settingQmlCode).arg(relativePath);