What is the proper things to be done in QQuickItem::updatePaintNode() ?



  • This is an update of my previous question:
    http://qt-project.org/forums/viewthread/49653/

    Finally I located the issue inside updatePaintNode function. I minimized the related code into several lines:
    @
    // Profile3DWidget is a subclass of QQuickItem
    QSGNode* Profile3DWidget::updatePaintNode(QSGNode * old_node, UpdatePaintNodeData * data)
    {
    if (!old_node)
    {
    old_node = new QSGGeometryNode();
    }
    }
    @
    The program crashes. But if I change the created node class to QSGNode, the program will not crash:
    @
    // Profile3DWidget is a subclass of QQuickItem
    QSGNode* Profile3DWidget::updatePaintNode(QSGNode * old_node, UpdatePaintNodeData * data)
    {
    if (!old_node)
    {
    old_node = new QSGNode();
    }
    }
    @
    So what should I do inside this function? Thanks!!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.