Yes, I did it.
I also tried to do a simple animation with Qt Quick because some people tell me it's optimized for smooth transitions, but I get also a lot of "jumps" on the animation. Here is the code I used:
import QtQuick 1.1
Rectangle {
id: window
width: 960
height: 360
color: "#000000"
states : State {
name: "left"
PropertyChanges { target: item1; x: -962 }
}
MouseArea {
id: mouseArea
onClicked: if (window.state == '') window.state = "left"; else window.state = ''
anchors.fill: parent
anchors.margins: -5 // Make MouseArea bigger than the rectangle, itself
}
transitions: Transition {
NumberAnimation { properties: "x"; easing.type: Easing.Linear; duration: 4000 }
}
Item {
id: item1
x: 0
y: 274
width: 1923
height: 86
Item {
id: pos1
x: 0
y: 0
width: 960
height: 86
smooth: false
clip: false
Rectangle {
id: rectangle3
x: 0
y: 0
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text3
x: 0
y: 0
width: 791
height: 41
color: "#ffffff"
text: qsTr("Some Text")
font.pixelSize: 40
font.family: "Helvetica"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangle4
x: 0
y: 45
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text4
x: 0
y: 0
width: 791
height: 41
color: "#ffffff"
text: qsTr("Some Text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
Item {
id: pos2
x: 962
y: 0
width: 959
height: 86
clip: false
smooth: false
Rectangle {
id: rectangle7
x: 0
y: 0
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text7
x: 0
y: 0
width: 960
height: 41
color: "#ffffff"
text: qsTr("Some other text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangle8
x: 0
y: 45
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text8
x: 0
y: 0
width: 960
height: 41
color: "#ffffff"
text: qsTr("Some other text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}
}
import QtQuick 1.1
Rectangle {
id: window
width: 960
height: 360
color: "#000000"
states : State {
name: "left"
PropertyChanges { target: item1; x: -962 }
}
MouseArea {
id: mouseArea
onClicked: if (window.state == '') window.state = "left"; else window.state = ''
anchors.fill: parent
anchors.margins: -5 // Make MouseArea bigger than the rectangle, itself
}
transitions: Transition {
NumberAnimation { properties: "x"; easing.type: Easing.Linear; duration: 4000 }
}
Item {
id: item1
x: 0
y: 274
width: 1923
height: 86
Item {
id: pos1
x: 0
y: 0
width: 960
height: 86
smooth: false
clip: false
Rectangle {
id: rectangle3
x: 0
y: 0
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text3
x: 0
y: 0
width: 791
height: 41
color: "#ffffff"
text: qsTr("Some Text")
font.pixelSize: 40
font.family: "Helvetica"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangle4
x: 0
y: 45
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text4
x: 0
y: 0
width: 791
height: 41
color: "#ffffff"
text: qsTr("Some Text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
Item {
id: pos2
x: 962
y: 0
width: 959
height: 86
clip: false
smooth: false
Rectangle {
id: rectangle7
x: 0
y: 0
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text7
x: 0
y: 0
width: 960
height: 41
color: "#ffffff"
text: qsTr("Some other text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangle8
x: 0
y: 45
width: 960
height: 41
color: "#424242"
radius: 5
Text {
id: text8
x: 0
y: 0
width: 960
height: 41
color: "#ffffff"
text: qsTr("Some other text")
font.family: "Helvetica"
font.pixelSize: 40
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks