Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
Description
Notice that the custom ListElement fields below are compilable (via required properties), but the custom PathAttribute fields are not.
Code
Adapted from the official examples at https://doc.qt.io/qt-6/qml-qtquick-pathview.html and https://doc.qt.io/qt-6/qml-qtquick-pathattribute.html)
import QtQuick Window { width: 640 height: 480 visible: true PathView { anchors.fill: parent model: ListModel { ListElement { name: "Bill Jones" icon: "qtlogo.png" } ListElement { name: "Jane Doe" icon: "qtlogo.png" } ListElement { name: "John Smith" icon: "qtlogo.png" } } delegate: Item { id: element required property url icon required property string name width: 80 height: 80 scale: PathView.iconScale opacity: PathView.iconOpacity Column { Image { anchors.horizontalCenter: nameText.horizontalCenter width: 64 height: 64 source: element.icon } Text { id: nameText text: element.name font.pointSize: 16 } } } path: Path { startX: 120; startY: 100 PathAttribute { name: "iconScale"; value: 1.0 } PathAttribute { name: "iconOpacity"; value: 1.0 } PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } PathAttribute { name: "iconScale"; value: 0.3 } PathAttribute { name: "iconOpacity"; value: 0.5 } PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 } } } }
qmlsc output
Warning: Main.qml:33:20: Member "iconScale" not found on type "QQuickPathView" [missing-property] scale: PathView.iconScale ^^^^^^^^^ Warning: Main.qml:33:20: Could not compile binding for scale: Cannot load property iconScale from QQuickPathViewAttached of QQuickPathViewAttached. [compiler] scale: PathView.iconScale ^^^^^^^^^ Warning: Main.qml:34:22: Member "iconOpacity" not found on type "QQuickPathView" [missing-property] opacity: PathView.iconOpacity ^^^^^^^^^^^ Warning: Main.qml:34:22: Could not compile binding for opacity: Cannot load property iconOpacity from QQuickPathViewAttached of QQuickPathViewAttached. [compiler] opacity: PathView.iconOpacity
Attachments
Issue Links
- relates to
-
QTBUG-114488 Modernize the DelegateModel/Package/DelegateModelGroup API
- Reported