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

Investigate completion requirements in QQmlPropertyCacheCreator

    XMLWordPrintable

Details

    Description

      In QQmlPropertyCacheCreator we want to guarantee that the type data of loaded components is completed before retrieving their compilation unit. However, there is in fact no way to do so because the property cache creator runs on the type loader thread and completion can only be signaled on the engine thread. Therefore, there is a TODO in the code that needs to be addressed:

                          // compositeType may not be the same type as qmlType because multiple engines
                          // may load different types for the same document. Therefore we have to ask
                          // our engine's type loader here.
                          QQmlRefPointer<QQmlTypeData> tdata
                                  = enginePrivate->typeLoader.getType(qmltype.sourceUrl());
                          Q_ASSERT(tdata);
                          // TODO: We would like to guarantee completion here, but getType() actually
                          //       only guarantees completion when called on the engine thread.
                          compositeType = tdata->compilationUnit()->qmlTypeForComponent();
      

      There used to be an assert in the same place which didn't seem to trigger in practice. However, it's hard to prove that this code path cannot be taken if the type data isn't complete.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes