QSGFlatColorMaterial Class
QSGFlatColorMaterial 类提供了一种在场景图中渲染纯色几何体的便捷方法。更多内容...
| 头文件: | #include <QSGFlatColorMaterial> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
| qmake: | QT += quick |
| 继承自: | QSGMaterial |
- 所有成员列表(包括继承的成员)
- QSGFlatColorMaterial 属于Qt Quick 场景图材质类。
公共函数
| QSGFlatColorMaterial() | |
| const QColor & | color() const |
| void | setColor(const QColor &color) |
详细说明
警告:此 实用类仅在使用Qt Quick 场景图的默认后端时才有效。
纯色材质将使用纯色填充几何体中的每个像素。该颜色可以包含透明度。
要使用平涂材质渲染的几何体,必须在QSGGeometry 对象的属性位置 0 中包含顶点,才能正确渲染。QSGGeometry::defaultAttributes_Point2D() 返回与该材质兼容的属性集。
纯色材质在更新其渲染状态时,会同时考虑当前不透明度和当前矩阵。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.