Storybook: LazyStackLayoutPage added
This commit is contained in:
parent
932e6e2820
commit
dd871c7e34
|
@ -0,0 +1,66 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import StatusQ.Core.Utils 0.1
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
LazyStackLayout {
|
||||
id: lazyStackLayout
|
||||
|
||||
currentIndex: indicator.currentIndex
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: 100
|
||||
|
||||
Component {
|
||||
Rectangle {
|
||||
color: "green"
|
||||
|
||||
Component.onCompleted: console.log("GREEN LOADED")
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
Rectangle {
|
||||
color: "red"
|
||||
|
||||
Component.onCompleted: console.log("RED LOADED")
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
Rectangle {
|
||||
color: "yellow"
|
||||
|
||||
Component.onCompleted: console.log("YELLOW LOADED")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PageIndicator {
|
||||
id: indicator
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
count: lazyStackLayout.count
|
||||
interactive: true
|
||||
|
||||
delegate: Rectangle {
|
||||
width: 40
|
||||
height: 40
|
||||
radius: 20
|
||||
border.width: 2
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// category: Controls
|
Loading…
Reference in New Issue