C
PaintedItem QML Type
允许使用平台上下文直接在帧缓冲区中绘图。更多...
| Import Statement: | import QtQuickUltralite.Extras 2.12 |
| Since: | Qt Quick Ultralite 1.9 |
| Inherits: |
属性
详细说明
PaintedItem 将绘制操作委托给 PaintedItemDelegate 类的派生对象,前提是该派生对象重写了 paint 方法。绘制操作可由派生类的属性更改事件触发。
派生类的 paint 方法允许帧缓冲区访问底层平台上下文,而不是使用图形设备进行绘制。
不同平台的平台上下文可能有所不同。例如,对于NXP ,它是 pxp 设备;对于 STM32,它是 DMA2D 设备;对于主机平台,则是底层的 QPainter 实例。在不支持硬件加速的平台上,可以通过直接像素操作将对象直接绘制到帧缓冲区中。
使用示例:
PaintedItem { id: paintedCircle1 anchors.right: parent.right anchors.top: parent.top anchors.fill: parent anchors.margins: 20 delegate_: CustomPaintedItemDelegate { id: delegate scale: root.scale onScaleChanged: { delegate.update() } } }
属性文档
delegate_ : Qul::PaintedItemDelegate
该属性保存了 PaintedItemDelegate 类的派生实例。
transform : list<Transform>
可以将变换对象附加到绘制对象上,以应用平移、缩放或旋转等变换。
有关更多信息,请参阅Transform 。
在某些 Qt 许可证下可用。
了解更多信息。