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

QText2DEntity isn't working with parent entity in constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.6.2, 6.7.0 Beta2, 6.8.0 FF
    • 5.13.0
    • Qt3D
    • None
    • 0d4a4a9ef (dev), 14264f82e (6.7), 6907e014f (6.6)

    Description

      I've got the issue with Qt3DExtras::QText2DEntity not working. But I found the workaround.
      Looks like there is a bug? in implementation of Qt3DExtras::QText2DEntity that prevents internal initialization (QText2DEntityPrivate::setScene is never called). This happens when scene is already visible and Qt3DExtras::QText2DEntity is created with parent entity passed to constructor. The workaround I used to make it work is to pass nullptr as a parent in constructor (or no arguments) and call ->setParent(parentEntity) in separate call.

       

      This is not working:
      m_text2dLabel = new Qt3DExtras::QText2DEntity(parentNode);

       

      This is working:
      m_text2dLabel = new Qt3DExtras::QText2DEntity();
      m_text2dLabel->setParent(parentNode);

      Attachments

        For Gerrit Dashboard: QTBUG-77139
        # Subject Branch Project Status CR V

        Activity

          People

            seanharmer Sean Harmer
            viper Marcin Musiał
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes