ItemLayer QML Type

A layer containing dynamic Qt Quick Ultralite items. 更多...

导入语句: import QtQuickUltralite.Layers .
Since: Qt Quick Ultralite 1.7




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 {
    width: 400
    height: 400
    depth: ItemLayer.Bpp16
    Rectangle {
        anchors.fill: parent
        color: "#3d464d"
    Image {
        anchors.centerIn: parent
        source: "qrc:/images/hello.png"

注意: This type is specific to Qt Quick Ultralite. See also the compatibility 页面。

另请参阅 应用程序 , Screen , ImageLayer , SpriteLayer ,和 使用硬件层改善性能 .


The preferred color depth to use for the layer.


常量 描述
ItemLayer.Bpp16 16 bits per pixel color depth, no alpha channel
ItemLayer.Bpp16Alpha 16 bits per pixel color depth, with alpha channel
ItemLayer.Bpp24 24 bits per pixel color depth, no alpha channel
ItemLayer.Bpp32 32 bits per pixel color depth, no 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.


常量 描述
LayerBase.OptimizeForSpeed The layer is optimized for fast rendering (default)
LayerBase.OptimizeForSize The layer is optimized for low memory usage