Commit e8a937d8 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Fixing the latest .qrc Qt Quick Application wizards



* The .ui.qml files were not properly generated.
* The .qrc file was wrong
* We have to use Window and set visible to true

Change-Id: I4617aba04048bebf744cf164013bd5af0aaadcd1
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent 06559417
import QtQuick 2.4
import QtQuick.Window 2.2
MainForm {
mouseArea.onClicked: {
Qt.quit();
}
Window {
visible: true
MainForm {
anchors.fill: parent
mouseArea.onClicked: {
Qt.quit();
}
}
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>mainForm.ui.qml</file>
<file>MainForm.ui.qml</file>
</qresource>
</RCC>
......@@ -7,6 +7,7 @@ ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
visible: true
menuBar: MenuBar {
Menu {
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>mainForm.ui.qml</file>
<file>MainForm.ui.qml</file>
</qresource>
</RCC>
......@@ -291,9 +291,33 @@ void QtQuickApp::handleCurrentProFileTemplateLine(const QString &line,
}
#ifndef CREATORLESSTEST
static QFileInfoList allFilesRecursive(const QString &path)
{
const QDir currentDirectory(path);
QFileInfoList allFiles = currentDirectory.entryInfoList(QDir::Files);
foreach (const QFileInfo &subDirectory, currentDirectory.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
allFiles.append(allFilesRecursive(subDirectory.absoluteFilePath()));
return allFiles;
}
Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const
{
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
const QFileInfoList templateFiles = allFilesRecursive(originsRoot());
//Deploy additional .qml files
foreach (const QFileInfo &templateFile, templateFiles) {
QString targetFileName = templateFile.fileName();
if (templateFile.suffix() == QLatin1String("qml")
&& targetFileName != QLatin1String("main.qml"))
files.append(file(readBlob(templateFile.absoluteFilePath(), errorMessage), outputPathBase() + targetFileName));
}
if (!useExistingMainQml()) {
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)));
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment