Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. PathView with few items change the positions
Qt 6.11 is out! See what's new in the release blog

PathView with few items change the positions

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 268 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    I defined a PathView as 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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved