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
of MyQQuickItem
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?