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. [Moved] Switch Y position
Forum Updated to NodeBB v4.3 + New Features

[Moved] Switch Y position

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.5k 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.
  • F Offline
    F Offline
    fmontigny
    wrote on last edited by
    #1

    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

    fmontigny

    "time is for all cannot simultaneously"

    [FRANCE]

    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