2022-06-03 11:26:02 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2013-04-19 13:38:08 +00:00
|
|
|
|
|
|
|
//![0]
|
2020-12-01 13:13:32 +00:00
|
|
|
import QtQuick
|
2013-04-19 13:38:08 +00:00
|
|
|
import "myscript.js" as Logic
|
|
|
|
|
|
|
|
Item {
|
|
|
|
width: 320
|
|
|
|
height: 480
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
color: "#272822"
|
|
|
|
width: 320
|
|
|
|
height: 480
|
|
|
|
}
|
|
|
|
|
2018-10-12 13:11:55 +00:00
|
|
|
TapHandler {
|
2013-04-19 13:38:08 +00:00
|
|
|
// This line uses the JS function from the separate JS file
|
2018-10-12 13:11:55 +00:00
|
|
|
onTapped: rectangle.rotation = Logic.getRandom(rectangle.rotation);
|
2013-04-19 13:38:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: rectangle
|
|
|
|
anchors.centerIn: parent
|
|
|
|
width: 160
|
|
|
|
height: 160
|
|
|
|
color: "green"
|
|
|
|
Behavior on rotation { RotationAnimation { direction: RotationAnimation.Clockwise } }
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
//![0]
|