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

Cyclic dependency warning for types of the same QML module

    XMLWordPrintable

Details

    Description

      When importing the same module within a type in that module a cyclic dependency warning is printed on the console.

      The cyclic dependency warning is correct in most cases, but when registering a QML singleton using qmlRegisterSingeltonType which depends on a C++ class registered in the same module using qmlRegisterType, the import seems to be needed in the singleton QML file (it can't resolve the type otherwise), although the engine reports about the cyclic dependency.

      Attached a small example which triggeres the problem.
      StyleSingleton.qml is registered in CommonUiBase as a singleton.
      OtherItem is a C++ type and registered in CommonUiBase as a normal type.

      StyleSingleton.qml needs to import CommonUiBase although it is part of that module in order to use OtherItem. This is causing the cyclic dependency warning.

      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
            gagi Dominik Holland
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes