← Back to team overview

touch-packages team mailing list archive

[Bug 1477363] [NEW] onDestruction is never called in the QML component

 

Public bug reported:

I have created a very simple application, and I want to capture the
onDestruction event. However, it is never called on a phone, but it is
called on the desktop. On the page,
http://developer.ubuntu.com/api/apps/qml/sdk-15.04/Qt.labs.settings.Settings/,
it is used to save the state of the application.

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

        Column {
            spacing: units.gu(1)
            anchors {
                margins: units.gu(2)
                fill: parent
            }

            Label {
                id: label
                objectName: "label"

                text: i18n.tr("Hello..")
            }

            Button {
                objectName: "button"
                width: parent.width

                text: i18n.tr("Tap me!")

                onClicked: {
                    label.text = i18n.tr("..world!")
                }
            }
        }

        Component.onDestruction: {
            console.log("ondestruction")
        }
    }

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1477363

Title:
  onDestruction is never called in the QML component

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  I have created a very simple application, and I want to capture the
  onDestruction event. However, it is never called on a phone, but it is
  called on the desktop. On the page,
  http://developer.ubuntu.com/api/apps/qml/sdk-15.04/Qt.labs.settings.Settings/,
  it is used to save the state of the application.

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

          Column {
              spacing: units.gu(1)
              anchors {
                  margins: units.gu(2)
                  fill: parent
              }

              Label {
                  id: label
                  objectName: "label"

                  text: i18n.tr("Hello..")
              }

              Button {
                  objectName: "button"
                  width: parent.width

                  text: i18n.tr("Tap me!")

                  onClicked: {
                      label.text = i18n.tr("..world!")
                  }
              }
          }

          Component.onDestruction: {
              console.log("ondestruction")
          }
      }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1477363/+subscriptions


Follow ups