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. Move view to specific Item on ListView inside Flickable
Qt 6.11 is out! See what's new in the release blog

Move view to specific Item on ListView inside Flickable

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

    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 { //...
    // ...
    }
    
    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