Accessing outer delegate data from nested Repeater



  • I'm making a grid with nested Repeaters and the inner delegate needs to know the "index" value of the outer delegate. I can do this by storing index into a temporary property, but this doesn't feel like the right solution. Is it possible for the inner delegate to directly access "index" in the outer delegate?

    import QtQuick 2.4
    import QtQuick.Controls 1.3
    
    ApplicationWindow {
        width: 640
        height: 480
        visible: true
    
        Row {
            Repeater {
                model: 4
    
                Column {
                    property int outer: index
    
                    Repeater {
                        model: 4
    
                        Text { text: index + "," + outer + "  " }
                    }
                }
            }
        }
    }
    

Log in to reply
 

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