Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Move view to specific Item on ListView inside Flickable



  • I have a Flickable, who has a Rectangle and a ListView inside (grouped in a ColumnLayout). This view has a ListView as delegate as well.
    I need to be able to move the view position (flickable.contentY) to a specific index (of both ListViews). How can I get these coordinates? How can I map the Flickable.contentY coordinate to the position of a specific element in ListViews?

    Imagine I have a ListView of Libraries (first ListView), where each element is a Library. Then, each Library has a ListView (second one) with all their books. I need to be able to move the Flickable to a specific book of a specific library.

    The QML looks like:

    Flickable {
        ColumnLayout {
            RectangleItem {}
                ListView {
                    // Libraries
                    model: //from C++
                    delegate: Item {
                        // Books
                        ListView { //...
    // ...
    }
    

Log in to reply