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. QML List View Bottom To Top
Qt 6.11 is out! See what's new in the release blog

QML List View Bottom To Top

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 887 Views
  • 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.
  • Q Offline
    Q Offline
    Qml_beginner
    wrote on last edited by
    #1

    Hi Guys,
    I am implementing a QML List View , where i am Populating some item.
    the item is really heavy , for that reason i am populating the List from bottom to top
    my item height can change on clikck of a button of item
    issue i am facing is when i click on the button the mouse pointer is no longer on top of button since the height of item has changed and its moving the item upwards on x - axis .

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.4
    import QtQuick.Layouts 1.3

    Window {
    width: 432
    height: 500
    visible: true
    title: qsTr("Hello World")

    ListView{
        implicitHeight: 500
        implicitWidth: 432
    
        verticalLayoutDirection : ListView.BottomToTop
    
        model: 10
        spacing: 10
    
        delegate: Rectangle{
            width: 100
            height: 50
    
            color: 'pink'
    
            Button{
               // x: 10
               // y: 10
    
                text: "Click Me"
    
                onClicked: {
                    if(parent.height === 50)
                        parent.height = 100
                    else
                        parent.height = 50
    
                    forceLayout()
                }
            }
        }
    }
    

    }

    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