Reputation: 680
I have a Qt3DWindow
which contains some 3D stuff. It is displayed as a widget in my Qt application using QWidget::createWindowContainer(QWindow*)
.
What would be the preferred way to draw some 2D graphics (like text, basic shapes, etc.) on top of this? Normally I would override QWidget::paintEvent
and use a QPainter
inside, but that's not possible with a Qt3DWindow
because it's not a widget.
Upvotes: 4
Views: 1450
Reputation: 3345
This could help you. Put this on top of your 3D view and you can draw text and shapes within the widget. It is not directly drawing on the 3D surface but I'm not sure if that's easily possible. If you want to achieve something like a HUD in video games you have to add a framegraph branch that does an orthographic projection of the respective textures.
Upvotes: 2