title: Iterating over states doesn't work for me
body: <p>I have an item with multiple <code>StateGroup</code>s:</p>
  
  <p><code>MyObject.qml</code></p>
  
  <pre><code>    import QtQuick 2.0
  
      Item
      {
          id: root
  
          property alias myStates: myStateGroup.states
  
          // ..
  
          StateGroup
          {
              id: myStateGroup
              states:
              [
                  State
                  {
                      name: "first"
                  },
                  State
                  {
                      name: "second"
                  },
                  State
                  {
                      name: "third"
                  }
              ]
          }
      }
  </code></pre>
  
  <p>I want to iterate over the state names: (in another file)</p>
  
  <pre><code>Component.onCompleted:
  {
      for (var i in instance.myStates)
      {
          console.log(JSON.stringify(i))
          console.log(i.name)
          //....
      }
  }
  </code></pre>
  
  <p>What I get is</p>
  
  <pre><code>"0"
  undefined
  "1"
  undefined
  "2"
  undefined
  </code></pre>
  
  <p>I want to iterate over the names of the states. What am I doing wrong that I get integers instead of <code>State</code>s?
  I know I could use a simple C-like for, but this looks really awful. I'd like to use the <code>for ... in</code> syntax.</p>