ItemLayer QML Type

A layer containing dynamic Qt Quick Ultralite items. More...

Import Statement: import QtQuickUltralite.Layers
Since: Qt Quick Ultralite 1.7



Detailed Description

Defines a layer in which Qt Quick Ultralite items can be shown.

Using several item layers can help reduce memory usage by lowering bit depths or using smaller item layers instead of a single item layer. The later is used when there are significant gaps in the UI without any content.

It's also possible to use the refreshInterval property to reduce the frame rate of certain layers. This results in lower CPU and GPU utilization and ensures that animations in higher priority layers stay smooth.

ItemLayer items have to be contained inside Screen or SpriteLayer items.

Example usage:

Application {
    Screen {
        ItemLayer {
            width: 400
            height: 400

            depth: ItemLayer.Bpp16

            Rectangle {
                anchors.fill: parent
                color: "#3d464d"

            Image {
                anchors.centerIn: parent
                source: "qrc:/images/hello.png"

Note: This feature may not be supported by hardware on all reference boards. For more information, see Supported Features table.

Note: This type is specific to Qt Quick Ultralite. See also the compatibility page.

See also Application, Screen, ImageLayer, SpriteLayer, and Improving performance using hardware layers.

Property Documentation

depth : enumeration

The preferred color depth to use for the layer.

Possible values:

ItemLayer.Bpp88 bits per pixel color depth, without alpha channel
ItemLayer.Bpp1616 bits per pixel color depth, without alpha channel
ItemLayer.Bpp16Alpha16 bits per pixel color depth, with alpha channel
ItemLayer.Bpp2424 bits per pixel color depth, without alpha channel
ItemLayer.Bpp3232 bits per pixel color depth, without alpha channel (default)
ItemLayer.Bpp32Alpha32 bits per pixel color depth, with alpha channel

platformId : int

A unique value to identify the layer to the platform.

For use with platform specific API to set custom layer properties.

refreshInterval : int

A value specifying the interval in frames between each redraw of the layer.

Not redrawing an animating layer on each frame can improve performance if the visual impact of updating at a lower refresh rate is acceptable.

For example, if this value is set to 2, then the layer contents will only be redrawn every second frame.

renderingHints : enumeration

The rendering optimization hints for the item layer.

The hints are used by the platform layer engine to configure the layer in the most optimal way for the application.

Possible values:

LayerBase.NoRenderingHintNo rendering hint specified
LayerBase.OptimizeForSpeedThe layer is optimized for fast rendering
LayerBase.OptimizeForSizeThe layer is optimized for low memory usage (default)

Available under certain Qt licenses.
Find out more.