Customization PathView



  • I have the code:

        PathView {
            id: view
            preferredHighlightBegin: 1
            preferredHighlightEnd: 1
            pathItemCount: Math.floor(Math.PI * activeTask.width * 340/(2 * 180 * 120))
            highlightRangeMode: PathView.ApplyRange//PathView.StrictlyEnforceRange
    
            anchors.fill: parent
            model: aTask.underTask
            delegate: delegateTask
    
            property int dragIndex: -1
    
            path: Path {
                startX: (activeTask.width / 2 - 35) * Math.cos(200 * Math.PI/180) + activeTask.width / 2
                startY: (activeTask.width / 2 - 35) * Math.sin(200 * Math.PI/180) + activeTask.width / 2
    
                PathArc {
                    x: (activeTask.width / 2 - 35) * Math.cos(160 * Math.PI/180) + activeTask.width / 2
                    y: (activeTask.width / 2 - 35) * Math.sin(160 * Math.PI/180) + activeTask.width / 2
                    radiusX: activeTask.width / 2 - 35
                    radiusY: activeTask.width / 2 - 35
                    useLargeArc: true
                }
            }
        }
    

    model write in C++ and added in QML like so:
    rootContext()->setContextProperty("aTask", &activeTask);

    I update model and in PathView visible only first element. but if move element then visible all elements. How to fix it?

    How to get to rotate elements in one direction only?
    How to make visible certain element?


  • Moderators

    Hi @Trikrista,

    I update model and in PathView visible only first element. but if move element then visible all elements. How to fix it?

    I guess this could be the problem with pathItemCount. The value must be evaluating to a non expected result. Possibly related to activeTask.width. For testing try hard coding the value.

    How to get to rotate elements in one direction only?

    AFAIK there is no such feature yet.

    How to make visible certain element?

    Use positionViewAtIndex.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.