1

I want to try to create un application for ubuntu-touch with QML !

I was created a simple application :

import QtQuick 2.0
import QtQuick.Controls 1.1
import Ubuntu.Components 0.1
import "components"


/*!
    \brief MainView with a Label and Button elements.
*/
import QtQuick.LocalStorage 2.0
import QtQuick.Layouts 1.1

MainView {
    // objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"

    // Note! applicationName needs to match the "name" field of the click manifest
    applicationName: "com.ubuntu.developer.z-admin-angels-gmail-com.oweMe"

    /*
     This property enables the application to change orientation
     when the device is rotated. The default is false.
    */
    automaticOrientation: true

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("oweMe")

        Column {
            anchors.rightMargin: 8
            anchors.bottomMargin: 8
            anchors.leftMargin: 24
            anchors.topMargin: 24
            spacing: units.gu(1)
            anchors {
                margins: units.gu(2)
                fill: parent
            }

            Row {
                id: gridButton
                x: 218
                y: 30
                width: 541
                height: 65

                Button {
                    objectName: "addDebpt"
                    text: i18n.tr("add debpt")
                    color: UbuntuColors.midAubergine
                    onClicked: {
                        var component = Qt.createComponent("qml/MyQmlFile.qml");
                                        if (component.status == Component.Ready)
                                            component.createObject(label1, {"x": 100, "y": 100});

                    }
                }

                /*Button {
                    width: 153
                    objectName: "addCommunBuy"
                    text: i18n.tr("add commun Buy")
                    color: UbuntuColors.lightAubergine
                    onClicked: {

                    }
                }*/

                Button {
                    width: 153
                    objectName: "removeDebpt"
                    text: i18n.tr("remove debpt")
                    color: UbuntuColors.lightAubergine
                    onClicked: {

                    }
                }

            } // ButtonGRID
        }

        GridLayout {
            id: gridForm
            x: 42
            y: 92
            width: 622
            height: 340

            Label {
                id: label1
                x: 227
                y: 218
                width: 272
                height: 89
                text: qsTr("Open QML HERE")
                font.pointSize: 21
                horizontalAlignment: Text.AlignHCenter
                wrapMode: Text.WrapAnywhere
            }
        }
    } // grid Content
}

When I lunch my application trought ubuntu i386 emulator, the application crash ... Or when I run it with desktop I have no problem

Application output :

Executing: /tmp/com.ubuntu.developer.username.oweme_0.1_all.click Launcher PID: 4502 AppId: com.ubuntu.developer.username.oweme_oweMe_0.1 Architecture: all

Transaction:    Installing files Status:    Waiting in queue Status:    Starting Status:    Finished Transaction:   Installing files Status:    Waiting in queue Status:    Waiting for authentication Status:  Waiting in queue Status:    Starting Status:    Finished Results: Installed    com.ubuntu.developer.username.oweme-0.1.all (installed:click,removable=1,app_name=oweMe) Application installed, executing Registering hooks Start Application Application started: 4572



Received a failed event The Application exited, cleaning up Transaction:    Removing Status:    Waiting in queue Status:    Starting Status:    Finished Transaction:   Removing Status:    Waiting in queue Status:    Waiting for authentication Status:  Waiting in queue Status:    Starting Status:    Finished Results:

and general output :

[15:38:15] ii click-reviewers-tools 0.8-0~214~ubuntu14.04.1

and my compilation output :

16:28:56: Running steps for project oweMe...
sending incremental file list
deleting qtc_device_debughelper.py
./
oweMe.desktop
oweMe.json

sent 682 bytes  received 89 bytes  1.54K bytes/sec
total size is 46.47K  speedup is 60.27
16:28:56: The process "/usr/bin/rsync" exited normally.
WARNING:root:Ignoring missing framework "ubuntu-sdk-14.10-dev2"
Successfully built package in './com.ubuntu.developer.username.oweme_0.1_all.click'.
16:28:56: The process "/usr/bin/click" exited normally.
16:28:56: The click package has been created in /home/morgan/build-oweMe-ubuntui386_GCC_i386_ubuntu_sdk_14_10_utopic-default
16:28:56: Connecting to device...
16:28:57: Uploading file '/home/morgan/build-oweMe-ubuntui386_GCC_i386_ubuntu_sdk_14_10_utopic-default/com.ubuntu.developer.username.oweme_0.1_all.click'...
16:28:57: Uploading file '/usr/share/qtcreator/ubuntu/scripts/qtc_device_applaunch.py'...
16:28:57: All files successfully deployed.
16:28:57: Deploy step finished.
16:28:57: Elapsed time: 00:02.
0

I have found the problem !

It's crash because I use

import QtQuick.Controls 1.1

without that, it's work well

  • Could you mark the question as solved by choosing your answer? – nik90 Aug 26 '14 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.