- import QtQuick 2.9
- import QtQuick.Window 2.2
- import QtQuick.Controls 2.2
-
- Window {
- visible: true
- width: 640
- height: 480
- title: qsTr("Hello World")
-
- property int index: 0
-
- StackView {
- id: stackview
- anchors.fill: parent
- initialItem: com1
- }
-
- Component {
- id: com1
- Rectangle {
- width: 200
- height: 200
- color: "red"
- }
- }
-
- Component {
- id: com2
- Rectangle {
- width: 200
- height: 200
- color: "yellow"
- }
- }
-
- Component {
- id: com3
- Rectangle {
- width: 200
- height: 200
- color: "blue"
- }
- }
-
- Button {
- width: 50
- height: 50
- anchors.centerIn: parent
- Text {
- anchors.centerIn: parent
- text: "button"
- color: "yellow"
- }
-