title: QML How can I get current element index in ListView?
body: <p>As example:</p>
  
  <pre><code>import QtQuick 2.4
  import QtQuick.Controls 1.3
  import QtQuick.Window 2.2
  import QtQuick.Dialogs 1.2
  
  ApplicationWindow {
      width: 250
      height: 250
      visible: true
  
      Rectangle {
          anchors.fill: parent
  
          ListModel {
              id: colorsModel
              ListElement { colorCode: "red"   }
              ListElement { colorCode: "green" }
              ListElement { colorCode: "blue"  }
              ListElement { colorCode: "orange"}
          }
  
          ListView {
              anchors.fill: parent
              snapMode: ListView.SnapOneItem
              model: colorsModel
  
              delegate: Rectangle {
                  width: 250
                  height: 250
                  color: colorCode
              }
  
              onMovementEnded: {
                  console.log($CurrentElementIndex$)
              }
          }
      }
  }
  </code></pre>
  
  <p>How can I get current element index to $CurrentElementIndex$ placeholder?</p>
  
  <p>ListView.currentIndex is only write property, as if I understand correctly.</p>
  
  <p>Maybe I can use ListView.indexAt(), but I don't understand how does it work.</p>