[Moved] Switch Y position



  • Hi,

    I want to create a custom scroll bar
    @GridView {
    id: gridview
    x: 16
    y: 77
    width: parent.width - x * 2
    height: 423
    clip: true
    cellWidth: 120
    model: ContactModel {}
    delegate: portraitEtudiant

        states: State {
            name: "ActionBars"
            when: gridview.movingVertically
            PropertyChanges { target: gridview; opacity: 0.5 }
            PropertyChanges { target: scroll; y: initXScrool()}
        }
    }
    
    function initXScrool()
    {
        var nb = scroll.y;
        console.log(gridview.contentY);
        if(gridview.contentY <= 0)
            return nb;
        if(gridview.contentY + 423 >= gridview.contentHeight)
            return arrawScrollBottom.y - scroll.height + 8;
    
        var p = gridview.contentY * 100 / gridview.contentHeight;
        return nb + p * (arrawScrollBottom.y - scroll.height + 8 - nb) / 100;
    }@
    

    It's good but i would to save my new X scroll position.
    What is the solution?

    thx


Log in to reply
 

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