Qml app wizard: Write import path to pro file.

Done-with: Alessandro Portale
This commit is contained in:
Christian Kamm
2010-09-21 14:55:11 +02:00
parent 427f775489
commit df01daa06b
2 changed files with 19 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END #
# Additional import path used to resolve Qml modules in Creator's code model
# QML_IMPORT_PATH #
QML_IMPORT_PATH =
# Avoid auto screen rotation
# ORIENTATIONLOCK #
DEFINES += ORIENTATIONLOCK

View File

@@ -248,6 +248,21 @@ void QmlStandaloneApp::handleCurrentProFileTemplateLine(const QString &line,
// ### disabled for now; figure out the private headers problem first.
//uncommentNextLine = true;
Q_UNUSED(uncommentNextLine);
} else if (line.contains(QLatin1String("# QML_IMPORT_PATH"))) {
QString nextLine = proFileTemplate.readLine(); // eats 'QML_IMPORT_PATH ='
if (!nextLine.startsWith(QLatin1String("QML_IMPORT_PATH =")))
return;
proFile << nextLine;
const QLatin1String separator(" \\\n ");
const QDir proPath(path(AppProPath));
foreach (const QString &importPath, m_importPaths) {
const QString relativePath = proPath.relativeFilePath(importPath);
proFile << separator << relativePath;
}
proFile << endl;
}
}