Here is a MWE:
import QtQuick 2.12
import QtQuick.Controls 2.5
ApplicationWindow
{
visible: true
width: 640
height: 480
title: swipeView.contentData[swipeView.currentIndex].text; // doesnt work
SwipeView
{
id: swipeView
anchors.fill: parent
Repeater
{
id: itemRepeater;
model: 6
Loader
{
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
sourceComponent: Text
{
text: index
Component.onCompleted: console.log("created:", index)
Component.onDestruction: console.log("destroyed:", index)
}
}
}
}
}
I would like to have access to the currently viewed item (in the swipeView
). I am trying to do that with the window title, but it doesn't work. What is the proper way of accessing the currently viewed object properties?