Symbian: Provides a template for creating a ListView delegate. More...
Inherited by SelectionListItem.
This element was introduced in Qt Quick Components 1.0.
A ListItem does not contain any visible content by default, it has only an invisible padding area to which you can anchor other items. This means that all the ListItem components in a list can have common margins.
A ListItem with the padding rectangle drawn as white
A ListItem with items anchored to the padding area
The following code snippet implements a ListItem with a text item on the top and subtitle text below. The two items are aligned in a column and they have the standard vertical spacing for a ListItem. The code snippet results a default state list item shown in the list below.
ListItem { id: listItem1 Column { anchors.fill: listItem1.paddingItem ListItemText { id: titleText mode: listItem1.mode role: "Title" text: "Title text" } ListItemText { id: subtitleText mode: listItem1.mode role: "SubTitle" text: "Subtitle text" } } }
A ListItem can have one of the four internal states:
See also ListHeading, ListItemText, and ListView.
If true, the user can interact with this list item. If false, the list item is disabled and does nothing when the user selects it. The default value of the property is true.
The mode of the ListItem.
This property can be used to create an association between ListItem and ListItemText. This way ListItemText is aware of the internal state of ListItem.
ListItem { id: listItem2 ListItemText { anchors.fill: listItem2.paddingItem role: "Title" mode: listItem2.mode text: "Hello world!" } }
The invisible padding rectangle for the ListItem that objects can be anchored to.
Symbian:
If platformInverted is true, the component is visualized with the inverted style. For more information, see Using Inverted Style with Symbian Components. By default platformInverted is false.
This property group was introduced in Qt Quick Components 1.1.
If true, the list item shows a graphical indication that pressing it will show the user another item to select. For example, when the user presses the item, another ListView is shown to the user.
The default value of the property is false.
Note: It is the responsibility of a developer to implement what happens when a ListItem with a subItemIndicator is pressed. This can be done by handling the pressed signal of a ListItem.
ListItem with with a subitem indicator
This signal is emitted when the user presses on the list item for the "long press" period of time. The length of time for a long press is the same as for MouseArea::onPressAndHold() which is currently 800ms.