Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Access model in another qml component

$
0
0
Hi, I need to access a model from another qml component. My model holds four strings: - deviceImage – euro – kwh – time   //...   Row {          id: deviceRow          spacing: 20            Repeater {                           id: deviceRepeater                           model: *timeslotmodel*                             Button {id: deviceImageButton; anchors.verticalCenter: parent.verticalCenter; iconSource: *deviceImage*; width: 100; height: 100; }                               }                         }                     }                 }             }                 TimelineDeviceDetail {}   //... And I need to access “euro, kwh, time” in TimelineDeviceDetail: //...    Text {             id: euroText             *text: euro*             anchors.top: parent.top             anchors.topMargin: 20             anchors.left: parent.left             anchors.leftMargin: 20             font.pixelSize: 12         }           Text {             id: kwhText             *text: kwh*             anchors.top: parent.top             anchors.topMargin: 20             anchors.horizontalCenter: parent.horizontalCenter             font.pixelSize: 12         }           Text {             id: timeText             *text: time*             anchors.top: parent.top             anchors.topMargin: 20             anchors.right: parent.right             anchors.rightMargin: 20             font.pixelSize: 12         } //... How can I do this? How can I delegate them to TimelineDeviceDetail? Thanks

Viewing all articles
Browse latest Browse all 4972

Trending Articles