Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.7
- import QtQuick.Controls 2.0
- import QtQuick.Layouts 1.3
- ApplicationWindow {
- visible: true
- width: 640
- height: 480
- title: qsTr("Hello World")
- StackView {
- id: swipeView
- anchors.fill: parent
- initialItem: Component {
- id: main
- Page {
- Text {
- text: qsTr("Hello main")
- anchors.centerIn: parent
- }
- }
- }
- }
- Component {
- id: testComponent
- Loader {
- property string custom
- sourceComponent: pageComp
- active: StackView.status != StackView.Inactive
- }
- }
- Component {
- id: pageComp
- Page {
- id: page
- property string innerProp: custom
- Text {
- text: page.innerProp
- anchors.centerIn: parent
- }
- }
- }
- footer: TabBar {
- id: tabBar
- TabButton {
- text: qsTr("Add")
- onClicked: {
- swipeView.push(testComponent,{"custom":"Custom text"})
- }
- }
- TabButton {
- text: qsTr("remove")
- enabled: swipeView.depth > 1
- onClicked: {
- swipeView.pop()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement