import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") Flickable { id: flick anchors.fill: parent contentWidth: 5000 contentHeight: 5000 onContentXChanged: Qt.callLater(rect.update) onContentYChanged: Qt.callLater(rect.update) Rectangle { color: 'red' x: 2000 y: 2000 width: 1000 height: 1000 } Rectangle { id: rect color: 'green' width: flick.width - 200 height: flick.height - 200 function update() { x = flick.contentX + 100 y = flick.contentY + 100 } } } }