Hi,
i need some programming help. I have a SlideshowView that uses a VisualItemModel. So far the model is static - which works fine. However, now i need to a have a dynamic model (i basically need to add or remove an Item - depending on the configuration). The question now is - how can i solve this? How can i have a dynamic VisualItemModel - rebuilding the model is possible from a business point of view, but how can i realize that? I could not find any examples handling this problem.
My code basically looks like this. How can i add remove the dividendsColumn depending on a boolean flag?
VisualItemModel {
id: viewsModel
Item {
id: marketdataColumn
width: viewsSlideshow.width
height: viewsSlideshow.height
MarketdataView {
id: marketdataView
width: parent.width
height: parent.height
}
}
Item {
id: dividendsColumn
width: viewsSlideshow.width
height: viewsSlideshow.height
DividendsView {
id: dividendsView
width: parent.width
height: parent.height
}
}
}
SlideshowView {
id: viewsSlideshow
model: viewsModel
onCurrentIndexChanged: {
openTab(currentIndex)
}
Behavior on opacity {
NumberAnimation {
}
}
onOpacityChanged: {
if (opacity === 0) {
slideshowVisibleTimer.start()
}
}
}