Qt Reference Documentation

QML Style Element

Symbian: Provides platform-specific style parameters for fonts, colors, and layouts. More...

  • List of all members, including inherited members
  • Properties

    Detailed Description

    You should use these parameters when you want to make your UI consistent with the Symbian platform style. Symbian-style is exposed as a context property named platformStyle. It is not possible to instantiate a Style object in QML, but the style must be accessed through the context property. The following example illustrates how to use the style parameters.

     Item {
         width: text.width + icon.width + platformStyle.paddingSmall + 2 * platformStyle.paddingMedium
         height: Math.max(text.height, icon.height) + 2 * platformStyle.paddingMedium
    
         Image {
             id: icon
             anchors.left: parent.left
             anchors.leftMargin: platformStyle.paddingMedium
             anchors.verticalCenter: parent.verticalCenter
             width: platformStyle.graphicSizeSmall
             height: platformStyle.graphicSizeSmall
             ...
         }
    
         Text {
             id: text
             anchors.left: icon.right
             anchors.leftMargin: platformStyle.paddingSmall
             anchors.right: parent.right
             anchors.rightMargin: platformStyle.paddingMedium
             anchors.verticalCenter: parent.verticalCenter
             font.family: platformStyle.fontFamilyRegular
             font.pixelSize: platformStyle.fontSizeLarge
             color: platformStyle.colorNormalLight
             ...
         }
     }

    The actual return values of the properties may vary between device configurations. For example, if the resolutions of two devices are different, it is probable that the pixel values of the properties are different.

    Property Documentation

    read-onlyborderSizeMedium : int

    The size for medium size border parts of a BorderImage in pixels.


    read-onlycolorChecked : color

    The foreground color for the checked state.


    read-onlycolorDisabledDark : color

    The dark foreground color for the disabled state.


    read-onlycolorDisabledLight : color

    The light foreground color for the disabled state.


    read-onlycolorDisabledMid : color

    The mid foreground color for the disabled state.


    read-onlycolorHighlighted : color

    The foreground color for a highlighted item.


    read-onlycolorNormalDark : color

    The default dark foreground color.


    read-onlycolorNormalLight : color

    The default light foreground color.


    read-onlycolorNormalLink : color

    The default foreground color for a link, for example a URL.


    read-onlycolorNormalMid : color

    The default mid foreground color.


    read-onlycolorPressed : color

    The foreground color for the pressed state.


    read-onlycolorTextSelection : color

    The background color for a selected item.


    read-onlyfontFamilyRegular : string

    The default font family.


    read-onlyfontSizeLarge : int

    The pixel size for a large font.


    read-onlyfontSizeMedium : int

    The pixel size for a medium size font.


    read-onlyfontSizeSmall : int

    The pixel size for a small font.


    read-onlygraphicSizeLarge : int

    The size of a large graphical object, for example an Image, in pixels.


    read-onlygraphicSizeMedium : int

    The size of a medium size graphical object, for example an Image, in pixels.


    read-onlygraphicSizeSmall : int

    The size of a small graphical object, for example an Image, in pixels.


    read-onlygraphicSizeTiny : int

    The size of a tiny graphical object, for example an Image, in pixels.


    read-onlypaddingLarge : int

    The size of a large padding in pixels.


    read-onlypaddingMedium : int

    The size of a medium size padding in pixels.


    read-onlypaddingSmall : int

    The size of a small padding in pixels.