Meego Wiki
Views

PopupList API Snapshot

From MeeGo wiki
Jump to: navigation, search

Contents

Description

The PopupList component contains a button which opens a spinnable list of entries when clicked. The list of entries as well as the number of entries displayed at a time can be set. The entries will adapt their size to the given height, but the width must be set big enough to allow the tags in your model to be displayed without being cut at their sides.

API Properties

alias pathItemCount
Sets the number of items displayed at the same time in the spinner
int fontSize
Sets the size in pixels for non-highlighted entries in the spinner. Changes to smaller size automatically if the entry's height is insufficient for the chosen size.
variant popupListModel
PathView.model, sets the model used for the list entries
variant value
Sets the value which will be used in the function reInit() to set the PathView's focus at

Signals

valueSelected
Propagates that a value has been selected
Parameters:
  • int index, the index of the entry in the model
  • variant tag, the content of the selected entry

Functions

reInit
Sets the focus of the PathView to the entry whose tag matches the property value.
getCurrentIndex
Returns the model index of the current value
Return value:
  • int index, the current index

Example

AppPage {

    PopupList {
        id: popup

        width:  150
        height: 200
        popupListModel: myModel

        onValueSelected: {
            // do something
        }

        ListModel {
            id:myModel

            ListElement { tag: "1" }
            ListElement { tag: "2" }
            ListElement { tag: "3" }
            ListElement { tag: "4" }
            ListElement { tag: "5" }
        }
    }
}
Personal tools