Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. What is the proper things to be done in QQuickItem::updatePaintNode() ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 478 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jiandingzhe
    wrote on last edited by
    #1

    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!!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved