MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML ListButton Element

ListButton is similar to Button except that ListButton resizes according to the content size More...

Inherits Item

This element was introduced in qt-components 4.7.

Properties

Signals

Detailed Description

The ListButton component has a label and click event handling. It is similar to a Button except that ListButton resizes according to the content size.

 ListButton {
     text: "Some Text"
     style: ListButtonStyle {}
 }

Property Documentation

checkable : bool

Property default is false

If a button's checkable property is set to true, then it can have two alternative checked states, on or off. If the button is checked, then checked is true. The checkable and Button::checked properties are set to false by default.

         Button {
             id: button1
             width: 200; height: 50
             text: "Checkable"
             checkable: true
             onClicked: output = text + " clicked"

         }

checked : bool

Property default is false

Specify the checked state. It only works if Button::checkable is set to true


font : Font

Property default is set from values defined in ButtonStyle

Font styling can be overwritten by setting custom values for e.g. font.pixelSize = 22


iconSource : url

Property default is ""

The path to the icon image to be used. If you want a different icon for the checked state, you can write:

 iconSource: (checked) ? "path to icon checked" : "path to normal icon"

platformStyle : QtObject

Property default is ButtonStyle{}

Property for styling the component. You can set one of the following style elements:

  • ListButtonStyle{ inverted: true } - Used on dark background, with a shorter height

pressed : bool

(ReadOnly) Is true when the button is pressed


text : string

Property default is ""

The text displayed on button.


Signal Documentation

ListButton::clicked ()

Signal for detecting button clicks. If the button is pressed, released, then this signal will be emitted.

The signal handler, onClicked(), can bind to state changes or other actions.