2025-10-11 02:30:58 +02:00
|
|
|
import QtQuick 6.8
|
2025-10-12 03:10:14 +02:00
|
|
|
import QtQuick.Controls 6.8
|
|
|
|
|
import QtQuick.Controls.Basic 6.8
|
2025-10-11 02:30:58 +02:00
|
|
|
import QtQuick.Layouts 6.8
|
2025-10-12 03:10:14 +02:00
|
|
|
|
2025-10-11 02:30:58 +02:00
|
|
|
import QYRComponents 1.0
|
|
|
|
|
|
|
|
|
|
ApplicationWindow {
|
2025-10-13 13:30:03 +02:00
|
|
|
id: root
|
2025-10-11 17:55:56 +02:00
|
|
|
width: 1280
|
|
|
|
|
height: 800
|
2025-10-18 21:40:02 +02:00
|
|
|
title: qsTr("QYouVideo")
|
2025-10-17 22:29:12 +02:00
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
flags: Qt.Dialog
|
|
|
|
|
modality: Qt.ApplicationModal
|
|
|
|
|
|
|
|
|
|
header: Rectangle {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 43
|
|
|
|
|
|
|
|
|
|
color: Colors.surface0
|
2025-10-11 17:55:56 +02:00
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
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
|
2025-10-11 17:55:56 +02:00
|
|
|
}
|
|
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
Label {
|
|
|
|
|
heading: "h2"
|
|
|
|
|
text: stack.depth
|
|
|
|
|
}
|
2025-10-11 17:55:56 +02:00
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
Item {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
}
|
2025-10-13 02:55:16 +02:00
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
Button {
|
|
|
|
|
text: qsTr("Videos")
|
|
|
|
|
outlined: true
|
|
|
|
|
implicitWidth: 80
|
|
|
|
|
onClicked: if (stack.currentItem.StackView.index > 0) stack.push(stackVideoList)
|
2025-10-13 02:55:16 +02:00
|
|
|
}
|
2025-10-19 22:35:30 +02:00
|
|
|
Button {
|
|
|
|
|
text: qsTr("About")
|
|
|
|
|
outlined: true
|
|
|
|
|
implicitWidth: 80
|
2025-10-13 02:55:16 +02:00
|
|
|
}
|
2025-10-19 22:35:30 +02:00
|
|
|
Button {
|
|
|
|
|
text: qsTr("Upload")
|
2025-10-12 03:10:14 +02:00
|
|
|
}
|
2025-10-19 22:35:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StackView {
|
|
|
|
|
id: stack
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.margins: 20
|
|
|
|
|
|
|
|
|
|
initialItem: ViewVideoList {
|
|
|
|
|
id: stackVideoList
|
|
|
|
|
}
|
2025-10-17 22:29:12 +02:00
|
|
|
|
2025-10-19 22:35:30 +02:00
|
|
|
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);
|
|
|
|
|
// }
|
2025-10-11 02:30:58 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|