How to disable updatePaintNode on a QQuickItem at will
-
I have a
QQuickItem
derived class// Class class MyQQuickItem : public QQuickItem { Q_OBJECT } // updatePaintNode in cpp function QSGNode * MyQQuickItem::updatePaintNode(QSGNode * oldNode, UpdatePaintNodeData * updatePaintNodeData) { // draw UI logic return node; } // QML component MyQQuickItem { id: my_quick objectName: "myquickitem" width : 500 height : 500 }
I am doing something on a separate UI which causes the
updatePaintNode
ofMyQQuickItem
to be fired. If I have a pointer to MyQQuickItem on cpp side like so,QQuickItem * my_quick_item_ptr = m_qml_engine->rootObjects()[0]->findChild<QQuickItem*>("myquickitem");
How can disable
MyQQuickItem
's updatePaintNode from getting called when I don't want it to?
Secondary question: If yes, How to reinstate it back again? -
Hi,
What about just setting the visible property to false ?
-
@SGaist I am taking
MyQQuickItem
& rendering it off screen on aQQuickRenderControl
to run some algorithms & do other stuff. To renderMyQQuickItem
I am setting its parent usingSetParentitem
to my off screen window. For this work properly, I needMyQQuickItem
to not update itself & stay visible.Hence making visible false is not an option for me. Any other way to block the updatePaintNode call?
-
So some kind of boolean property Q_PROPERTY (e.g. renderingEnabled) that you would check at rendering time to know if you should do anything ?
-
Hi Roby Brundle,
I have the same problem.
I also want to disable seft update for exist QQuickItem.
Did you found the solution yet?