Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Ubuntu SDK QML tutorial a simple currency converter is build. The complete QML source code can be found here. When working through the example I found the following snippet somewhat confusing, particularly line 92 where the index field is assigned to caller.currencyIndex.

ListView {
    clip: true
    width: parent.width
    height: parent.height - header.height
    model: currencies
    delegate: Standard {
        objectName: "popoverCurrencySelector"
        text: currency
        onClicked: {
            caller.currencyIndex = index // where does index come from?

I couldn't find any clue in the documentation where index is defined. What it should contain is absolutely obvious, but where does it come from? If it is a property of the Standard list view item it is nowhere documented.

share|improve this question
up vote 3 down vote accepted

index is a property of the ListView delegate, not necessarily a ListItem. It represents the number of the currentItem. From the docs:

The index is exposed as an accessible index property. Properties of the model are also available depending upon the type of Data Model.

share|improve this answer
That was exactly the piece of documentation I was looking for! Would've never expected this to be a property of the delegate. – ubuntudroid Mar 3 '14 at 8:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.