QPaintedItem drawing complexity
-
Hi all,
I am trying to draw using QPaintedItem .
I can see two options to paint :
1 . void QQuickPaintedItem::paint(QPainter *painter)2 . QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)
I'm assuming that both will use the OpenGL for painting.
I find using QPainter is very easy to draw. However drawing using updatePaintNode(..) is little complex.What is the difference between these two ?
Can somebody help me here . -
@Ajay-Krishna
the sole purpose ofQQuickPaintedItem
is the drawing via QPainter in the QML scene graph. This paints (via CPU) into a texture and then draws the texture via OpenGL.
So when using this class do not overrrideupdatePaintNode()
-
@raven-worx Which one is better to use void QQuickPaintedItem::paint(QPainter *painter) or QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data) ?
-
@Ajay-Krishna
"Better" speaking of performance is updatepaintnode(), if thats too complex for you to use (example), use the QQuickPaintedItem