This is my code:
import QtQuick 2.0
import QtQuick.Window 2.1
Window {
id:parent
height:Screen.height
width:Screen.width
Image {
id:home3
source:"images.png"
height: Screen.height
width:Screen.width
}
Rectangle {
id:rect1
height:Screen.height
width:Screen.width
color:"Green"
SmoothedAnimation{
id:anim;
target:rect2
properties: "x"
to:0
duration: 500
}
}
Rectangle {
id:rect2
height:Screen.height
width:Screen.width
color:"red"
x:rect1.x-2000
SmoothedAnimation{
id:anim1;
target:rect1
properties: "x"
to:0
duration: 500
}
}
}
Basically at the starting the rect1 is visible and when you swipe the screen from right to left the the animation anim should occur and the rect2 is visible and when you swipe from left to right on the rect2 the animation anim1 should occur…
↧









