Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-122177

Qt Quick 3D RuntimeLoader should have a "pickable" property

    XMLWordPrintable

Details

    Description

      Currently, there is no API to retrieve the internal Model created by RuntimeLoader, and no API to make it pickable. It would be nice to have a RuntimeLoader.pickable property.

       

      Manual hack
      Iterate across the RuntimeLoader's children to find the Model and make it pickable:

      RuntimeLoader {
          id: loader
          source: "..."
      
          function makeChildModelsPickable(node) {
              if (node?.pickable !== undefined) // Only Models have a `pickable` property defined
                  node.pickable = true
              node.children.forEach(childNode => makeChildModelsPickable(childNode))
          }
      
          Component.onCompleted: makeChildModelsPickable(loader) // Mark the model at startup
          onSourceChanged: makeChildModelsPickable(loader) // Mark the model each time we change the source file
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes