Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

30 seconds chart in qml

By: a guest on Mar 23rd, 2011  |  syntax: None  |  size: 0.56 KB  |  views: 909  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import Qt 4.7
  2.  
  3. Rectangle {
  4.     id: root
  5.     width: 500
  6.     height: 500
  7.  
  8.     property int vvv: 10
  9.  
  10.     Repeater {
  11.         model: 10
  12.  
  13.         Rectangle {
  14.             anchors.bottom: parent.bottom
  15.             x: (index*(width+10))-30
  16.             width: root.width / 12
  17.             height: Math.sin(index+vvv)*30+100/index + vvv
  18.             color: Qt.darker('blue', Math.cos(index/10))
  19.  
  20.             Behavior on height { PropertyAnimation { } }
  21.         }
  22.     }
  23.  
  24.     MouseArea {
  25.         anchors.fill: parent
  26.         onClicked: root.vvv += 30
  27.     }
  28. }
clone this paste RAW Paste Data