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

QMesh reloads when reparenting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.2
    • Qt3D
    • None
    • All

    Description

      I am using Qt3D in our C++ application, and use shared QMesh instances to render meshes.

      Our resource system decrypts data to a QByteArray. Because QMesh doesn't allow loading directly from data, I save the data to a temporary file and set that as source.

      When loading is done, I obviously delete the temporary file as I don't want the decrypted content to be in a file longer as absolutely possible.

      Because we share the QMesh instance, its parent can change. Before I delete a QEntity, I make sure to remove any shared QMesh instances and set their parent to nullptr. This avoids the shared QMesh being deleted by the parent entity's destructor. That seems to work as intended.

      However, after adding the shared (already loaded) mesh to another entity, the loading state seems to be triggered again. I don't set the source at this point: I just add the QMesh instance to an entity.

      Later the Error state is triggered. And the mesh does not appear.

      If I don't remove the temporary files, it works again. How come?

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            jedi Jeroen Dierckx
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes