[Solved] iOS Style Rearrange of Icons
Page |
2 |
So far this is my flow implementation and it runs and the icons squiggle but I cannot move the widgets around:
- import Qt 4.7
- Rectangle {
- width: 640
- height: 480
- color: "#000000"
- Flow {
- id:flowtest
- x: 0
- y: 0
- anchors.rightMargin: 0
- anchors.bottomMargin: 4
- anchors.leftMargin: 8
- anchors.topMargin: 4
- anchors.fill: parent
- anchors.margins: 4
- spacing: 10
- Image {
- source: "Images/widget.png"
- id: number1
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number1.x; to: number1.x + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number1.y; to: number1.y + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number2
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number2.x; to: number2.x - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number2.y; to: number2.y - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number3
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number3.x; to: number3.x + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number3.y; to: number3.y + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number4
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number4.x; to: number4.x - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number4.y; to: number4.y - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number5
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number5.x; to: number5.x + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number5.y; to: number5.y + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number6
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number6.x; to: number6.x - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number6.y; to: number6.y - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number7
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number7.x; to: number7.x - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number7.y; to: number7.y - 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Image {
- source: "Images/widget.png"
- id: number8
- PropertyAnimation on x { running: number1.state=="squiggle"; from: number8.x; to: number8.x + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- PropertyAnimation on y { running: number1.state=="squiggle"; from: number8.y; to: number8.y + 1; duration: 100; loops: Animation.Infinite; easing.type: Easing.OutInBounce }
- }
- Transition {
- NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
- }
- }
- MouseArea {
- id: mouse_area1
- x: 0
- y: 0
- width: 640
- height: 480
- drag.target: number1
- onPressAndHold:{
- if(number1.state != "squiggle")
- {
- number1.state="squiggle"
- number2.state="squiggle"
- number3.state="squiggle"
- number4.state="squiggle"
- number5.state="squiggle"
- number6.state="squiggle"
- number7.state="squiggle"
- number8.state="squiggle"
- }
- else
- {
- number1.state="Base State"
- number2.state="Base State"
- number3.state="Base State"
- number4.state="Base State"
- number5.state="Base State"
- number6.state="Base State"
- number7.state="Base State"
- number8.state="Base State"
- }
- }
- }
- }
This has been made in to a Wiki Entry: http://developer.qt.nokia.com/wiki/Drag_and_Drop_within_a_GridView
I used the code in the following path, but when i added more list modle element in the list , i can’t scroll the list if i want to move the last element in the end, what should i do ?
This has been made in to a Wiki Entry: http://developer.qt.nokia.com/wiki/Drag_and_Drop_within_a_GridView
You must log in to post a reply. Not a member yet? Register here!





