Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.5.0, 5.15, 6.7
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.