MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML ButtonStyle Element

ButtonStyle properties and default values explained More...

Inherits Style

Inherited by GroupButtonStyle, ListButtonStyle, NegativeButtonStyle, PositiveButtonStyle, SheetButtonAccentStyle, SheetButtonStyle, TabButtonStyle, ToolButtonStyle, and TumblerButtonStyle.

This element was introduced in qt-components 4.7.

Properties

Detailed Description

Custom platformStyle example

 Button {
     platformStyle: ButtonStyle {
         fontFamily: "Arial"
         fontPixelSize: 21
         fontCapitalization: Font.SmallCaps
         fontWeight: Font.Light
         horizontalAlignment: Text.AlignLeft
         textColor: "black"
         pressedTextColor: "red"
         disabledTextColor: "gray"
         checkedTextColor: "blue"
         buttonWidth: 200
         buttonHeight: 30
         position: "[horizontal-center]"
     }
 }

Property Documentation

background : string

Property default value is "image://theme/meegotouch-button"+__invertedString+"-background"+(position?"-"+position:"").

Defines the default background image.


backgroundMarginBottom : int

Property default value is 22.

Defines the background image bottom margin.


backgroundMarginLeft : int

Property default value is 22.

Defines the background image left margin.


backgroundMarginRight : int

Property default value is 22.

Defines the background image right margin.


backgroundMarginTop : int

Property default value is 22.

Defines the background image top margin.


buttonHeight : int

Property default value is UI.BUTTON_HEIGHT.

Defines the button height.


buttonWidth : int

Property default value is UI.BUTTON_WIDTH.

Defines the button width.


checkedBackground : string

Property default value is "image://theme/meegotouch-button"+__invertedString+"-background-selected"+(position?"-"+position:"").

Defines the checked state background image.


checkedDisabledBackground : string

Property default value is "image://theme/meegotouch-button"+__invertedString+"-background-disabled-selected"+(position?"-"+position:"").

Defines the disabled checked state background image.


checkedTextColor : color

Property default value is UI.COLOR_BUTTON_INVERTED_FOREGROUND.

Defines the text colour, which is shown when the button is checked.


disabledBackground : string

Property default value is "image://theme/meegotouch-button"+__invertedString+"-background-disabled"+(position?"-"+position:"").

Defines the disabled state background image.


disabledTextColor : color

Property default value is UI.COLOR_BUTTON_DISABLED_FOREGROUND.

Defines the text colour, which is shown when the button is disabled.


fontCapitalization : int

Property default value is Font.MixedCase.

Defines the font capitalization.


fontFamily : string

Property default value is UI.FONT_FAMILY.

Defines the font family for the button.


fontPixelSize : int

Property default value is UI.FONT_DEFAULT_SIZE.

Defines the font pixel size.


fontWeight : int

Property default value is Font.Bold.

Defines the font weight.


horizontalAlignment : int

Property default value is Text.AlignHCenter.

Defines the text horizontal alignment.


mouseMarginBottom : real

Property default value is 0.0.

Defines mouse area bottom margin.


mouseMarginLeft : real

Property default value is 0.0.

Defines the mouse area left margin.


mouseMarginRight : real

Property default value is 0.0.

Defines the mouse area right margin.


mouseMarginTop : real

Property default value is 0.0.

Defines the mouse area top margin.


position : string

Property default value is "".

Defines the button position.

Following values are used to define position:

  • [horizontal-left]
  • [horizontal-center]
  • [horizontal-right]
  • [vertical-top]
  • [vertical-center]
  • [vertical-bottom]

pressedBackground : string

Property default value is "image://theme/meegotouch-button"+__invertedString+"-background-pressed"+(position?"-"+position:"").

Defines the pressed state background image.


pressedTextColor : color

Property default value is UI.COLOR_BUTTON_SECONDARY_FOREGROUND.

Defines the text colour, which is shown when the button is pressed.


textColor : color

Property default value is "inverted ? UI.COLOR_BUTTON_INVERTED_FOREGROUND : UI.COLOR_BUTTON_FOREGROUND".

Defines the colour of the text.