forked from qt-creator/qt-creator
Qml app wizard: Write import path to pro file.
Done-with: Alessandro Portale
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user