ComboBox
Provides a drop-down list functionality. More...
Inherits FocusScope
This type was introduced in QtQuick.Controls 1.0.
Properties
- activeFocusOnPress : bool
- currentIndex : int
- currentText : string
- hovered : bool
- model : model
- pressed : bool
- style : Component
- textRole : string
Detailed Description
Add items to the comboBox by assigning it a ListModel, or a list of strings to the model property.
ComboBox { width: 200 model: [ "Banana", "Apple", "Coconut" ] }
Example 2:
ComboBox { model: ListModel { id: cbItems ListElement { text: "Banana"; color: "Yellow" } ListElement { text: "Apple"; color: "Green" } ListElement { text: "Coconut"; color: "Brown" } } width: 200 onCurrentIndexChanged: console.debug(currentText + ", " + cbItems.get(currentIndex).color) }
You can create a custom appearance for a ComboBox by assigning a ComboBoxStyle.
Property Documentation
activeFocusOnPress : bool |
This property specifies whether the combobox should gain active focus when pressed. The default value is false.
read-onlyhovered : bool |
This property indicates whether the control is being hovered.
read-onlypressed : bool |
This property holds whether the button is being pressed.
style : Component |
The style Component for this control.
See also Qt Quick Controls Styles QML Types.