I'm trying to create a Parallax View based on a SwipeView element. Examples in QML documentation illustrate how to achieve it with ListView:
Image { id: background source: "background.png" fillMode: Image.TileHorizontally x: -list.contentX / 2 width: Math.max(list.contentWidth, parent.width) } ListView { id: list anchors.fill: parent spacing: 20 snapMode: ListView.SnapToItem orientation: ListView.Horizontal highlightRangeMode: ListView.StrictlyEnforceRange boundsBehavior: Flickable.StopAtBounds maximumFlickVelocity: 1000 model: _some_cpp_list //Loader is used as a workaround for QTBUG-49224 delegate: Loader { id: loaderDelegate source: "MyDelegate.qml" width: myScreen.width height: myScreen.height onLoaded: { loaderDelegate.item.logic = modelData } } } Now, this works, but instad of ListView I want to use SwipeView, since it requires less code to achieve the behaviour I want:
SwipeView { id: list anchors.fill: parent spacing: 20 Repeater { model: _some_cpp_list delegate: MyDelegate { logic: modelData } } Is there any way I could access SwipeView's current "x" position or swipe offset to use in this line:
x: -list.contentX / 2?
The closest I've found so far is x: -swipeView.contentData[0].x / 2, but it causes jumping over items rather than smooth transition.