Adjust .qmlproject files generated by wizards to new format

This commit is contained in:
Kai Koehne
2010-01-26 22:03:17 +01:00
parent 5c16f706c6
commit f3cf0c36cb
3 changed files with 42 additions and 72 deletions

View File

@@ -103,26 +103,40 @@ Core::GeneratedFiles QmlNewProjectWizard::generateFiles(const QWizard *w,
QLatin1String("qml"));
QString contents;
QTextStream out(&contents);
out
<< "import Qt 4.6" << endl
<< endl
<< "Rectangle {" << endl
<< " width: 200" << endl
<< " height: 200" << endl
<< " Text {" << endl
<< " x: 66" << endl
<< " y: 93" << endl
<< " text: \"Hello World\"" << endl
<< " }" << endl
<< "}" << endl;
{
QTextStream out(&contents);
out
<< "import Qt 4.6" << endl
<< endl
<< "Rectangle {" << endl
<< " width: 200" << endl
<< " height: 200" << endl
<< " Text {" << endl
<< " x: 66" << endl
<< " y: 93" << endl
<< " text: \"Hello World\"" << endl
<< " }" << endl
<< "}" << endl;
}
Core::GeneratedFile generatedMainFile(mainFileName);
generatedMainFile.setContents(contents);
QString projectContents;
{
QTextStream out(&projectContents);
out
<< "import QmlProject 1.0" << endl
<< "Project {" << endl
<< " QmlFiles {" << endl
<< " directory: \".\"" << endl
<< " }" << endl
<< "}" << endl;
}
Core::GeneratedFile generatedCreatorFile(creatorFileName);
generatedCreatorFile.setContents(projectName + QLatin1String(".qml\n"));
generatedCreatorFile.setContents(projectContents);
Core::GeneratedFiles files;
files.append(generatedMainFile);