| 1 |
// Copyright (C) 2017 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
import QtQuick 2.0 |
| 5 |
import QtQuick.Controls 1.2 |
| 6 |
import QtQuick.Controls.Styles 1.3 |
| 7 |
|
| 8 |
Rectangle { |
| 9 |
width: 1024 |
| 10 |
height: 1024 |
| 11 |
color: "white" |
| 12 |
|
| 13 |
TextRectangle { |
| 14 |
id: textRect |
| 15 |
} |
| 16 |
|
| 17 |
Rectangle { |
| 18 |
id: rect |
| 19 |
x: 0 |
| 20 |
y: 0 |
| 21 |
width: 200 |
| 22 |
height: 200 |
| 23 |
color: "red" |
| 24 |
|
| 25 |
ColorAnimation { |
| 26 |
target: rect |
| 27 |
loops: Animation.Infinite |
| 28 |
property: "color" |
| 29 |
from: "blue" |
| 30 |
to: "green" |
| 31 |
duration: 2000 |
| 32 |
running: true |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
Rectangle { |
| 37 |
id: rect2 |
| 38 |
width: 300 |
| 39 |
height: 100 |
| 40 |
anchors.right: parent.right |
| 41 |
anchors.bottom: parent.bottom |
| 42 |
color: "red" |
| 43 |
|
| 44 |
ColorAnimation { |
| 45 |
target: rect2 |
| 46 |
loops: Animation.Infinite |
| 47 |
property: "color" |
| 48 |
from: "red" |
| 49 |
to: "white" |
| 50 |
duration: 2000 |
| 51 |
running: true |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
Button { |
| 56 |
id: button |
| 57 |
width: 100 |
| 58 |
height: 80 |
| 59 |
anchors.top: rect.bottom |
| 60 |
anchors.left: parent.left |
| 61 |
text: "button" |
| 62 |
scale: 2.0 |
| 63 |
} |
| 64 |
CheckBox { |
| 65 |
id: checkbox |
| 66 |
width: 200 |
| 67 |
height: 180 |
| 68 |
scale: 2.0 |
| 69 |
text: "checkbox" |
| 70 |
checked: true |
| 71 |
anchors.top: parent.top |
| 72 |
anchors.right: parent.right |
| 73 |
|
| 74 |
Timer { |
| 75 |
interval: 1000 |
| 76 |
repeat: true |
| 77 |
running: true |
| 78 |
onTriggered: { |
| 79 |
checkbox.checked = !checkbox.checked; |
| 80 |
} |
| 81 |
} |
| 82 |
} |
| 83 |
Slider { |
| 84 |
anchors.bottom: parent.bottom |
| 85 |
anchors.left: parent.left |
| 86 |
width: 400 |
| 87 |
value: 0.0 |
| 88 |
minimumValue: 0 |
| 89 |
maximumValue: 1 |
| 90 |
|
| 91 |
PropertyAnimation on value { |
| 92 |
loops: Animation.Infinite |
| 93 |
duration: 3000 |
| 94 |
from: 0.0 |
| 95 |
to: 1.0 |
| 96 |
running: true |
| 97 |
} |
| 98 |
} |
| 99 |
} |