Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 8.0.2
-
None
Description
In Qt Creator's QML code editor, referencing inline components defined in another QML file does not work properly. It seems that they are not recognized at all. Steps to reproduce:
1. New project > Application (Qt) > Qt Quick Application
2. Build system - qmake (probably not important, but that's what I use)
3. All other options default
4. New File > Qt > QML File (Qt Quick 2) > Images.qml > Add to qml.qrc
Prefix: /
5. Images.qml contents:
import QtQuick 2.15 Item { component LabeledImage: Column { property alias source: image.source property alias caption: text.text Image { id: image width: 50 height: 50 } Text { id: text font.bold: true } } }
6. Go back to main.qml and try using Images.LabeledImage
import QtQuick 2.15 import QtQuick.Window 2.15 Window { Images.LabeledImage { caption: "Caption" } width: 640 height: 480 visible: true title: qsTr("Hello World") }
Expected Behavior: Images.LabeledImage is recognized and autocompletion for its properties is available.
Observed Behavior: Qt Creator shows an error "Unknown Component. (M300)", and autocompletion is not available. Building and running the project works as expected and the LabeledImage is shown, so the issue is just in the code editor.
Inline components defined in the same file are recognized and work without issues.
Using Qt Creator 8.0.2.