Synchronize tableview scrollbars



  • Hi,
    i have 2 Tableviews in my qml file. One on the left side and one on the right. Both have the same amount of columns and rows, but different cell data.
    If the user scrolls in one of the tableviews the other should also scroll.
    Does anyone know a good solution for this? I did not find any events like 'onScroll' or so.

    I also tried to put all the data in one table but it looks terrible.


  • Moderators

    @PhTe flickableItem is your friend here. It could be done as follows:

    //Inside some TableView
    flickableItem.onContentYChanged: {
         mirror.flickableItem.contentY = flickableItem.contentY //mirror = id of other table 
    }
    

Log in to reply
 

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