Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Clarification on QSGNode::preprocess()
Qt 6.12 LTS is out! See what's new in the release blog

Clarification on QSGNode::preprocess()

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.6k 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.
  • ? Offline
    ? Offline
    A Former User
    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
      • ? Offline
        ? Offline
        A Former User
        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
        • Unsolved