Qt Reference Documentation

QML TumblerColumn Element

Represents a column in a Tumbler. More...

This element was introduced in Qt Quick Components 1.0.

Properties

Detailed Description

Creating a TumblerColumn

The code snippet below illustrates how to create a Tumbler using TumblerColumn.

 TumblerColumn {
     id: dayColumn
     selectedIndex: 9
     items: daysList

     for (var day = 1; day <= 31; day++) {
         daysList.append({"value" : day});
     }
 }

 TumblerColumn {
     id: monthColumn
     selectedIndex: 4
     items: monthsList
 }

 ListModel {
     id: monthsList
     ListElement { value: "Jan" }
     ListElement { value: "Feb" }
     ListElement { value: "Mar" }
     ListElement { value: "Apr" }
     ListElement { value: "May" }
     ListElement { value: "Jun" }
     ListElement { value: "Jul" }
     ListElement { value: "Aug" }
     ListElement { value: "Sep" }
     ListElement { value: "Oct" }
     ListElement { value: "Nov" }
     ListElement { value: "Dec" }
 }

 TumblerColumn {
     id: yearColumn
     selectedIndex: 88
     items: yearsList

     for (var year = 1900; year <= 2011; year++) {
         yearsList.append({"value" : year});
     }
 }

 Tumbler {
      columns: [monthColumn, dayColumn, yearColumn]
 }

Property Documentation

enabled : bool

The TumblerColumn is enabled if the value is true; otherwise it is disabled. The default value is true.


items : variant

The model containing the contents for the Tumbler to render. The Tumbler's delegate assumes that the model data is provided via the modelData role and interprets it as a text string.

Note: If the model contains only one named role, it is always provided via the modelData role. This also applies to a simple string list model. For more information, see QML Data Models documentation.


label : string

The label of the TumblerColumn. The default value is "".

Note: This property is deprecated and should not be used.


selectedIndex : int

The selected index of the TumblerColumn. The default value is 0.