Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 9.0.1
-
None
Description
Description
For properties with the type of inline component that is defined in other QML documents the code completion doesn't work unless the property type is changed to `var`
Steps to reproduce
- create a simple qml project with the following files:
- main.qml
import QtQuick import QtQuick.Window Window { width: 640 height: 480 visible: true title: qsTr("Hello World") ValuesProvider { id: valuesProvider } MouseArea { id: ma hoverEnabled: true property ValuesProvider.ValuesSet currentValues: valuesProvider.defaultValues states: [ State { name: "hover" when: ma.pressed PropertyChanges { target: ma currentValues: valuesProvider.hoverValues } }, State { name: "pressed" when: ma.pressed PropertyChanges { target: ma currentValues: valuesProvider.pressedValues } } ] } }
- main.qml
-
- ValuesProvider.qml
import QtQuick import QtQmlQtObject { id: root component ValuesSet : QtObject { property int val1: 0 property int val2: 2 property int val3: 3 } property ValuesSet defaultValues: ValuesSet {} property ValuesSet pressedValues: ValuesSet { val3: 8 } property ValuesSet hoverValues: ValuesSet { val1: 10 val2: 4 } }
- ValuesProvider.qml
- start adding new property for `ma` (average of values from `currentValues` property)
`property real valuesAvarage: currentValues.` - Wait for the code completion popup to appear
- change the `currentValues` property type to var (`property var currentValues: valuesProvider.defaultValues`)
- Repeat steps 2 and 3
Actual result
Popup doesn't show properties of ValuesSet type instead it interprets property type as ValuesProvider (unless changed to `var` type)
Expected result
Code completion works appropriately with both scenarios
Possible bug location:
Due to limited capacity, I'm not able to build and debug the Qt Creator but this please looks suspicious to me (maybe another case handling is missing)
https://github.com/qt-creator/qt-creator/blob/master/src/libs/qmljs/qmljscontext.cpp#L108