-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.5.8, 6.6.3
-
None
The QML Type Compiler indicates "Warnings occurred while importing module" and the when using the QML Component in question, it appears to not be found.
To replicate the issue:
- Create 2 or more QML modules with qt_add_qml_module. Each module must have a QML file
- Import one module, let's call it second module, into the other module, let's call it main module
- Import and instantiate a QML component of the second module from the main module.
- ENABLE_TYPE_COMPILER on both modules
Example code is attached. Important excerpts here:
// Second module's CMakeLists.txt
qt_add_qml_module(${PROJECT_NAME}
URI SharedModule
VERSION 1.0
RESOURCE_PREFIX /qt/qml/
QML_FILES
"SharedModule.qml"
ENABLE_TYPE_COMPILER
)
// Second module's .qml file
Rectangle {
color: "#234567"
}
// First module's CMakeLists.txt
qt_add_qml_module(${PROJECT_NAME}
URI Experiments
VERSION 1.0
RESOURCE_PREFIX /qt/qml/
IMPORTS
SharedModule
QML_FILES
"main.qml"
ENABLE_TYPE_COMPILER
)
// First module's .qml file
import SharedModule
SharedModule {
width: 400
height: 200
}
Note:
This fails in the same way regardless of whether the modules are imported Dynamically or Statically.
- depends on
-
QTBUG-96040 (qmltc) Support build infrastructure around object-creation compiler
-
- Open
-
- relates to
-
QTBUG-122321 qmltc: WebEngineView with anchors causes assertion at component creation
-
- Closed
-