Qt Reference Documentation

QML ListHeading Element

Symbian: Provides a heading for a list or a section in a list. More...

This element was introduced in Qt Quick Components 1.0.

Properties

Detailed Description

ListHeading can be used as the header at the top of a list or as a header for sections within a list. ListHeading only draws a background, so ListItemText is typically used to display text on top of ListHeading. ListItemText provides styled fonts for the ListItem and ListHeading components.

The area to which Items can be added within ListHeading is defined by the paddingItem property. ListItemText can be anchored to the paddingItems anchor lines.

The following two examples illustrate how to use ListHeading with ListItemText.

Using a ListHeading as a list header

 Component {
     id: listHeader

     ListHeading {
         id: listHeading

         ListItemText {
             id: headingText
             anchors.fill: listHeading.paddingItem
             role: "Heading"
             text: "Test list"
         }
     }
 }

 ListView {
     id: listView
     anchors.fill: parent
     header: listHeader
     ...
 }

The screenshot below illustrates the result of the code snippet.

Using a ListHeading as a section header

 Component {
     id: sectionHeader

     ListHeading {
         id: sectionHeading

         ListItemText {
             id: headingText
             anchors.fill: sectionHeading.paddingItem
             role: "Heading"
             text: "Items with " + section + " in them:"
         }
     }
 }

 ListModel {
     id: listModel
     ListElement {
         image: "list2.png"
         ...
     }
     ...
 }

 ListView {
     id: listView
     anchors.fill: parent
     model: listModel
     section.property: "image"
     section.delegate: sectionHeader
     ...
 }

The screenshot below illustrates the result of the code snippet.

See also ListItem and ListItemText.

Property Documentation

paddingItem : Item

The invisible padding rectangle for the ListHeading that objects can be anchored to.


platformInverted : bool

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.