Qt 6.11 is out! See what's new in the release
blog
PathView with few items change the positions
-
I defined a
PathViewas follow:PathView { id: view property int item_gap: 60 anchors.fill: parent pathItemCount: 3 preferredHighlightBegin: 0.5 preferredHighlightEnd: 0.5 highlightRangeMode: PathView.StrictlyEnforceRange highlightMoveDuration: 1000 snapMode: PathView.SnapToItem rotation: -90 model: modelContent delegate: DelegateContent { } path: Path { startX: view.width + item_gap; startY: view.height / 2 PathAttribute { name: "iconScale"; value: 0.7 } PathAttribute { name: "iconOpacity"; value: 0.1 } PathAttribute { name: "iconOrder"; value: 0 } PathLine {x: view.width / 2; y: view.height / 2; } PathAttribute { name: "iconScale"; value: 1 } PathAttribute { name: "iconOpacity"; value: 1 } PathAttribute { name: "iconOrder"; value: 9 } PathLine {x: -item_gap; y: view.height / 2; } } }When I have 3 or more items they are correctly positioned on the screen:
- the selected one is centered
- the others are placed at the edges of the screen so I can see only a portion of those (this is the intended behavior)
But if the items are 2, the selected one is still centered, but the other is not visible until I select it.
Instead I still want to see it at the edge, like before...What I have to change in order to achieve this behavior?
Qt 6.2.0 under Ubuntu 20.04