// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
Rectangle {
id: appWindow
width: 360
height: 360
signal trigger
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
//Qt.quit();
trigger();
var component = Qt.createComponent("Note.qml");
var sprite = component.createObject(appWindow, {"x": 100, "y": 100, "color":"blue"});
if (sprite == null) {
// Error Handling
console.log("Error creating object");
}
trigger.connect(sprite.move);
}
}
onTrigger: {
console.log("parent trigger");
}
}
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
Rectangle {
id: note
width: 100
height: 62
color: "red"
signal move();
MouseArea {
anchors.fill: parent
onClicked: {
note.destroy();
}
}
onMove:
{
x += 100
}
}