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

A component can't be attached to many nodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7, 5.8.0 Alpha
    • Qt3D
    • None

    Description

      There is an incoherence between the API and implementation of QComponent.

      QComponent have the shareable property but it can't be attached twice to differents nodes, because the addComponent implementation doesn't allow it.

      My initial goal is to share a QGeometryRenderer between many entities, this to reuse the geometry buffers.

      Actually as workaround I share the QGeometry, but a QNode seems to be able to have only one parent by his API.

      Take a look to the workaround code :

                              QGeometryRenderer*  clonedGeometryRenderer = new QGeometryRenderer();
      
                              clonedGeometryRenderer->setGeometry(geometryRenderer->geometry());
                              clonedGeometryRenderer->geometry()->setParent(clonedGeometryRenderer);
                              subEntity->addComponent(clonedGeometryRenderer);
      

      Here I need to set parent to the cloned geometry, else it doesn't work. The geometry is correctly shared even if it as only one parent, because it stay the child of many geometryRenderer.

      Attachments

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

        Activity

          People

            whagen Wieland Hagen
            flamaros Xavier Bigand
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes