C
ItemLayer QML Type
A layer containing dynamic Qt Quick Ultralite items. More...
Import Statement: | import QtQuickUltralite.Layers |
Since: | Qt Quick Ultralite 1.7 |
Inherits: |
Properties
- depth : enumeration
- platformId : int
- refreshInterval : int
- renderingHints : enumeration
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:
ApplicationScreens { 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 ApplicationScreens, Screen, ImageLayer, SpriteLayer, and Improving performance using hardware layers.
Property Documentation
depth : enumeration |
The preferred color depth to use for the layer.
Possible values:
Constant | Description |
---|---|
ItemLayer.Bpp8 | 8 bits per pixel color depth, without alpha channel |
ItemLayer.Bpp16 | 16 bits per pixel color depth, without alpha channel |
ItemLayer.Bpp16Alpha | 16 bits per pixel color depth, with alpha channel |
ItemLayer.Bpp24 | 24 bits per pixel color depth, without alpha channel |
ItemLayer.Bpp32 | 32 bits per pixel color depth, without alpha channel (default) |
ItemLayer.Bpp32Alpha | 32 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. The default rendering hints is platform-specific. If no default is provided by the platform, LayerBase.OptimizeForSize
is used.
Possible values:
Constant | Description |
---|---|
LayerBase.NoRenderingHint | No rendering hint specified |
LayerBase.OptimizeForSpeed | The layer is optimized for fast rendering |
LayerBase.OptimizeForSize | The layer is optimized for low memory usage |
Available under certain Qt licenses.
Find out more.