| 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 |
focus: true |
| 13 |
|
| 14 |
Rectangle { |
| 15 |
id: rect |
| 16 |
x: 0 |
| 17 |
y: 0 |
| 18 |
width: 200 |
| 19 |
height: 200 |
| 20 |
color: "red" |
| 21 |
} |
| 22 |
|
| 23 |
Rectangle { |
| 24 |
id: rect2 |
| 25 |
width: 300 |
| 26 |
height: 100 |
| 27 |
anchors.right: parent.right |
| 28 |
anchors.bottom: parent.bottom |
| 29 |
color: "blue" |
| 30 |
} |
| 31 |
|
| 32 |
Button { |
| 33 |
id: button |
| 34 |
width: 100 |
| 35 |
height: 80 |
| 36 |
anchors.top: rect.bottom |
| 37 |
anchors.left: parent.left |
| 38 |
text: "button" |
| 39 |
scale: 2.0 |
| 40 |
} |
| 41 |
CheckBox { |
| 42 |
id: checkbox |
| 43 |
width: 200 |
| 44 |
height: 180 |
| 45 |
scale: 2.0 |
| 46 |
text: "checkbox" |
| 47 |
checked: true |
| 48 |
anchors.top: parent.top |
| 49 |
anchors.right: parent.right |
| 50 |
} |
| 51 |
Slider { |
| 52 |
anchors.bottom: parent.bottom |
| 53 |
anchors.left: parent.left |
| 54 |
width: 400 |
| 55 |
value: 1 |
| 56 |
minimumValue: 0 |
| 57 |
maximumValue: 1 |
| 58 |
|
| 59 |
onValueChanged: { |
| 60 |
rect.color = Qt.rgba(value, 0, 0, 1) |
| 61 |
rect2.color = Qt.rgba(0, 0, value, 1) |
| 62 |
} |
| 63 |
} |
| 64 |
} |