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. Clarification on QSGNode::preprocess()
Forum Updated to NodeBB v4.3 + New Features

Clarification on QSGNode::preprocess()

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.9k 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.
  • P Offline
    P Offline
    prismatic
    wrote on last edited by
    #1

    In the QSGNode preprocess() docs it says:
    Warning: Beware of deleting nodes while they are being preprocessed. It is possible, with a small performance hit, to delete a single node during its own preprocess call. Deleting a subtree which has nodes that also use preprocessing may result in a segmentation fault. This is done for performance reasons.

    Referring to the "QtQuick scene graph docs":http://doc-snapshot.qt-project.org/qt5-dev/qtquick/qtquick-visualcanvas-scenegraph.html,

    From what I can tell, QSGNode::preprocess() is called by the render thread. Scene manipulation (addition/removal of nodes) is also done by the render thread in QQuickItem::updatePaintNode(). Where can nodes be deleted such that I'd get a segmentation fault or other bad behavior?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      melghawi
      wrote on last edited by
      #2

      Is that a typo or are you asking how you can produce segfaults by deleting scene nodes?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        prismatic
        wrote on last edited by
        #3

        It's not a typo. I don't understand what conditions cause seg faults when I delete scene nodes. I'm pretty confused in general on how to deal with the new scene graph stuff since there's a separate render thread asynchronously doing stuff.

        If I have some custom opengl rendering in a QSGNode in the preprocess() call, will I get a seg fault when someone changes the QQuickView to another QML file and parts of my scene graph get deleted?

        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