Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
Description
Code
import QtQuick import QtQuick.Controls.Basic Window { width: 640 height: 480 visible: true enum MyEnum { Alpha, Bravo, Charlie } ComboBox { textRole: "key" valueRole: "value" model: ListModel { ListElement { key: "A"; value: Main.MyEnum.Alpha } ListElement { key: "B"; value: Main.MyEnum.Bravo } ListElement { key: "C"; value: Main.MyEnum.Charlie } } onActivated: console.log(currentIndex, currentText, currentValue) } }
qmlsc output
Warning: Main.qml:19:28: Could not compile binding for value: Cannot resolve property type for binding on value. [compiler] Warning: Main.qml:20:28: Could not compile binding for value: Cannot resolve property type for binding on value. [compiler] Warning: Main.qml:21:28: Could not compile binding for value: Cannot resolve property type for binding on value. [compiler]
Assigning string/numeric constants are fine, but assigning enums produces warnings. It doesn't matter whether the enums are defined in QML or C++.
Attachments
Issue Links
- relates to
-
QTBUG-96555 Enum's enclosing type as a qualifier breaks enums for ListElement (again)
- Closed
-
QTBUG-116481 Make QML ListModel compilable by qmlsc
- Reported