← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1560873] [NEW] InverseMouseArea API code snippet is wrong

 

Public bug reported:

https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.InverseMouseArea/

on the above link, the following code:

import QtQuick 2.4
import Ubuntu.Components 1.2
Item {
    width: 640
    height: 480
    Button {
        id: button
        text: "Press me"
        onClicked: {
            var component = Qt.createComponent("Popup.qml");
            var obj = component.create(parent);
            obj.visible = true;
        }
    }
}

when it runs, it complains:

"qrc:///Main.qml:26: TypeError: Property 'create' of object
QQmlComponent(0x3905890) is not a function"

The correct one should be "component.createObject(parent)"

Best regards,
XiaoGuo

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Low
     Assignee: Zoltan Balogh (bzoltan)
         Status: Confirmed

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

Title:
  InverseMouseArea API code snippet is wrong

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

Bug description:
  https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.InverseMouseArea/

  on the above link, the following code:

  import QtQuick 2.4
  import Ubuntu.Components 1.2
  Item {
      width: 640
      height: 480
      Button {
          id: button
          text: "Press me"
          onClicked: {
              var component = Qt.createComponent("Popup.qml");
              var obj = component.create(parent);
              obj.visible = true;
          }
      }
  }

  when it runs, it complains:

  "qrc:///Main.qml:26: TypeError: Property 'create' of object
  QQmlComponent(0x3905890) is not a function"

  The correct one should be "component.createObject(parent)"

  Best regards,
  XiaoGuo

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