import QtQuick 6.8 import QtQuick.Controls 6.8 import QtQuick.Controls.Basic 6.8 import QtQuick.Layouts 6.8 import QYRComponents 1.0 ApplicationWindow { id: root width: 1280 height: 800 title: qsTr("QYouVideo") flags: Qt.Dialog modality: Qt.ApplicationModal header: Rectangle { Layout.fillWidth: true height: 43 color: Colors.surface0 RowLayout { anchors.fill: parent anchors.margins: 3 Label { Layout.leftMargin: 5 text: "QYouVideo" heading: "h1" } Button { visible: stack.currentItem.StackView.index > 0 text: "Back" onClicked: stack.popCurrentItem() } Label { heading: "h2" text: stack.currentItem.StackView.index } Label { heading: "h2" text: stack.depth } Item { Layout.fillWidth: true } Button { text: qsTr("Videos") outlined: true implicitWidth: 80 onClicked: if (stack.currentItem.StackView.index > 0) stack.push(stackVideoList) } Button { text: qsTr("About") outlined: true implicitWidth: 80 } Button { text: qsTr("Upload") } } } StackView { id: stack anchors.fill: parent anchors.margins: 20 initialItem: ViewVideoList { id: stackVideoList } function openVideo(id) { // if (stack.find((item, index) => { // // If found player instance // if (item.id == id) { // // stack.pop(index, StackView.Immediate); // stack.push(item) // return true; // } // return false; // }) == null) { // If didn't find player instance const component = Qt.createComponent("VideoPlayer.qml"); const item = component.createObject(stack, {id: id}) stack.push(item); // } } } }