1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// Copyright (C) 2021 The Qt Company Ltd. import QtQuick Rectangle { id: page height: 480; property int input: 10 property int output: ball.y onInputChanged: ball.y = input Rectangle { id: ball onYChanged: { if (y <= 0) { y = page.height - 21; } else if (y >= page.height - 20) { y = 0; } } } }