Pascaldietz (Talk | contribs) (→Example) |
Pascaldietz (Talk | contribs) m (→API properties) |
||
| Line 26: | Line 26: | ||
:The currently selected title | :The currently selected title | ||
;''alias'' selectedIndex | ;''alias'' selectedIndex | ||
| - | :Int, stores the index of the currently selected item. Can be set from outside, but make sure it's set after a model is set, because setting a model resets the selectedIndex to -1. See the example below where selectedIndex is set | + | :Int, stores the index of the currently selected item. Can be set from outside, but make sure it's set after a model is set, because setting a model resets the selectedIndex to -1. See the example below where selectedIndex is set onCompleted. |
=Private properties= | =Private properties= | ||
Contents |
This is a button which carries a title and shows a flyout when clicked. The flyout can hold any content.
-
-
DropDown {
id: ddown
anchors.centerIn: parent
title: "DropDown"
titleColor: "black"
width: 400
minWidth: 400
maxWidth: 440
model: [ "First choice", "Second choice", "Third choice" ]
payload: [ 1, 2, 3 ]
iconRow: [
Image {
height: parent.height * 0.9
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: "image://themedimage/images/camera/camera_lens_sm_up"
}
]
onTriggered: {
//do something
}
Component.onCompleted: {
selectedIndex = 0
}
}