ok I solved it maybe other people also need it:
Item {
id: the_item
height: 480
width: 854
Rectangle {
id:rect
height: 120
width: 300
color: "blue"
anchors.verticalCenter: the_item.verticalCenter
anchors.horizontalCenter: the_item.horizontalCenter
NumberAnimation on rotation { id: rot; from: 0; to:230; duration: 2000; loops: Animation.Infinite }
NumberAnimation on opacity { id: opa; from: 1; to: 0.5; duration: 2000; loops: 1 }
onOpacityChanged: {
if(rect.opacity == 0.5){
opa.stop();
rot.stop();
}
}
}
Rectangle {
id: button
height: 50
width: 50
color: "red"
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: 15
anchors.topMargin: 15
MouseArea {
anchors.fill: parent
onPressed: {
if(rect.opacity == 0.5){
opa.start();
rot.start();
}
}
}
}
}
Item {
id: the_item
height: 480
width: 854
Rectangle {
id:rect
height: 120
width: 300
color: "blue"
anchors.verticalCenter: the_item.verticalCenter
anchors.horizontalCenter: the_item.horizontalCenter
NumberAnimation on rotation { id: rot; from: 0; to:230; duration: 2000; loops: Animation.Infinite }
NumberAnimation on opacity { id: opa; from: 1; to: 0.5; duration: 2000; loops: 1 }
onOpacityChanged: {
if(rect.opacity == 0.5){
opa.stop();
rot.stop();
}
}
}
Rectangle {
id: button
height: 50
width: 50
color: "red"
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: 15
anchors.topMargin: 15
MouseArea {
anchors.fill: parent
onPressed: {
if(rect.opacity == 0.5){
opa.start();
rot.start();
}
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks