Advertisement
Guest User

Untitled

a guest
Apr 10th, 2011
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4.     width: 300; height: 400
  5.  
  6.     ListModel {
  7.         id: appModel
  8.         ListElement { modelcolor: "#FF0000"}
  9.         ListElement { modelcolor: "#00FF00"}
  10.         ListElement { modelcolor: "#0000FF"}
  11.     }
  12.  
  13.     Component {
  14.         id: appDelegate
  15.  
  16.         Rectangle {
  17.             width: 100; height: 100
  18.             color: modelcolor
  19.  
  20.             MouseArea {
  21.                 anchors.fill: parent
  22.                 onClicked: parent.x = -50
  23.             }
  24.  
  25.             Behavior on x {
  26.                 NumberAnimation {
  27.                     duration: 2000
  28.                 }
  29.             }
  30.             Behavior on y {
  31.                 NumberAnimation {
  32.                     duration: 2000
  33.                 }
  34.             }
  35.         }
  36.     }
  37.  
  38.     GridView {
  39.         anchors.fill: parent
  40.         model: appModel
  41.         delegate: appDelegate
  42.  
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement