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

FontLoader in QML Singleton type causes ASSERT: "tdata->isComplete()" in file compiler\qqmlirbuilder.cpp, line 1819

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.4.0 Beta
    • 5.3.1
    • None
    • Qt Creator 3.1.2 (opensource)
      Based on Qt 5.3.1 (MSVC 2010, 32 bit)
      Built on Jun 23 2014 at 04:13:10
      From revision a791e851a7
    • 8fab54a5495226b8c06d7708357a23e83444abc0 (qtdeclarative)

    Description

      Using a singleton type in QML like the following snippet

      import QtQuick 2.0
      pragma Singleton
      QtObject {
          property string foo: "foo"
      
          FontLoader {
              id: theFont
              source: "MyFontFile.ttf"
          }
      }
      

      and saving it as MyType.qml, singleton type is registered using

          qmlRegisterSingletonType(QUrl::fromLocalFile(QFileInfo("qml/MyType.qml").absoluteFilePath()), "MyNamespace", 1, 0, "MyTypeSingleton");
      

      Accessing the "foo" property of the singleton somewhere else in QML like

      import QtQuick 2.0
      import MyNamespace 1.0
      Text {
          text: MyTypeSingleton.foo
      }
      

      causes strange error message, resulting in application crash :

      ASSERT: "tdata->isComplete()" in file compiler\qqmlirbuilder.cpp, line 1819
      

      Problem vanishes after replacing base type in MyType.qml "QtObject" by "Item" !?!?

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              manuelkoch Manuel Koch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes