QScene2D Class
class Qt3DRender::Quick::QScene2DThis class enables rendering qml into a texture, which then can be used as a part of 3D scene. More...
Header: | #include <Qt3DQuickScene2D/QScene2D> |
qmake: | QT += 3dquickscene2d |
Since: | Qt 5.9 |
Instantiated By: | Scene2D |
Inherits: | Qt3DCore::QNode |
This class was introduced in Qt 5.9.
Public Types
enum | RenderPolicy { Continuous, SingleShot } |
Public Functions
void | addEntity(Qt3DCore::QEntity *entity) |
QVector<Qt3DCore::QEntity *> | entities() |
QVector<Qt3DCore::QEntity *> | entities() const |
void | removeEntity(Qt3DCore::QEntity *entity) |
Detailed Description
This class uses QQuickRenderControl to render the given QQuickItem into an offscreen surface, which is attached to a texture provided by the user. This allows the component to directly render into the texture without intermediate copy and the user to freely specify how the texture is used in the 3D scene.
The entities using the QScene2D can be associated with the class to enable interaction with the item; if an entity has a QObjectPicker component, the pick events from that picker are sent to the QScene2D and converted to mouse events and finally sent to the item.
Note: Only mouse events are supported. The item does not support keyboard input.
Member Type Documentation
enum QScene2D::RenderPolicy
This enum type describes types of render policies available.
Member Function Documentation
void QScene2D::addEntity(Qt3DCore::QEntity *entity)
Adds an entity to the the QScene2D object. If the entities have QObjectPicker, the pick events from that entity are sent to QScene2D and converted to mouse events.
QVector<Qt3DCore::QEntity *> QScene2D::entities()
Retrieve entities associated with the QScene2D.
QVector<Qt3DCore::QEntity *> QScene2D::entities() const
Retrieve entities associated with the QScene2D.
void QScene2D::removeEntity(Qt3DCore::QEntity *entity)
Removes an entity from the the QScene2D object.