Qt Creator Documentation 2.8.0

Contents

QML Spinner Element

A spinner control to allow a user to select an item through swipe. More...

Properties

Detailed Description

The Spinner type can be styled using images and font properties.

Here is a simple ImageButton:

 import QtQuick 1.1
 import "components"

 Spinner {
     id: spinner2
     width: 90
     height: 185
     radius: 2
     border.color: "#000000"
     highlightImage: "images/spinner-select.png"
     initialIndex: 1
     textColor: "#000000"
     backGroundImage: "images/spinner-bg.png"
     font.family: "Arial"
     itemHeight: 29
     viewCount: 8
     font.bold: false
     border.width: 3
     font.pixelSize: 25
     model: ListModel {
         ListElement {
             index: 1
             value: 1
         }

         ListElement {
             index: 2
             value: 2
         }

         ListElement {
             index: 3
             value: 3
         }

         ListElement {
             index: 4
             value: 4
         }

         ListElement {
             index: 5
             value: 5
         }

         ListElement {
             index: 6
             value: 6
         }

         ListElement {
             index: 7
             value: 7
         }

         ListElement {
             index: 8
             value: 8
         }

         ListElement {
             index: 9
             value: 9
         }

         ListElement {
             index: 10
             value: 10
         }
     }

     onValueChanged: console.debug(value);
 }

Property Documentation

backGroundImage : url

The source image for the spinner's background.


border.color : string

The color used to draw the border of the spinner.


border.width : int

The width used to draw the border of the spinner.


font : font

The font properties of the text of the items in the list.


height : int

The height of the spinner.


highlightImage : url

The source image to highlight the selected item.


intialIndex : int

The intial item to be selected in the control.


itemHeight : int

The height of the individual items in the control.


radius : int

The corner radius used to draw a rounded rectangle.


textColor : string

The color of the text of the items in the list.


viewCount : int

How many items to show in the control at one time.


width : int

The width of the spinner.