Painting on top of QQuickView
Is it at all possible to paint (using
QPainter) on top of (i.e. like an overlay) a
I have a QML OSM map plugin loaded into a
QWidgetand I would like to draw on top of this using
QPainter(rather than using QML). Is this achieveable?
There appears to be no
paintEventor equivalent available when sub-classing
You can create a transaprent QQuickPaintedItem that stretches over your whole QML window, and paint there.
Just keep in mind that painting with QPainter is slower than with QML or OpenGL.
@sierdzio Thanks for your comments. Unfortunately I don't think what I ultimately want to do is possible due to the way QML and the
Basically, I have a 3rd party COM object which draws nautical charts. My existing
QWidgetapplication allows me to draw these charts in the
paintEventwhere I capture the
QWidgetand pass it to the
BeginPaint/EndPaintfunctions ready for painting this 3rd party chart.
The act of obtaining the
QQuickPaintedItemcauses a lot of issues and results in the underlying QML not being rendered.
I've managed to implement this another way and it works so far.