InverseMouseArea API code snippet is wrong

Bug #1560873 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Low
Zoltan Balogh

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

Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Zoltan Balogh (bzoltan)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.