37 lines
906 B
QML
37 lines
906 B
QML
import QtQuick
|
|
import QtQuick.Window
|
|
import QtQuick.Dialogs
|
|
import QtQuick.Controls
|
|
|
|
Window {
|
|
width: 640
|
|
height: 480
|
|
visible: true
|
|
title: qsTr("Hello World")
|
|
color: "darkgrey"
|
|
|
|
Button {
|
|
id: btnVideoFile
|
|
anchors.centerIn: parent
|
|
text: "Video File"
|
|
onClicked: videoFileDialog.open()
|
|
}
|
|
|
|
TextEdit {
|
|
id: txtVideoFile
|
|
text: ""
|
|
anchors.top: btnVideoFile.bottom
|
|
anchors.horizontalCenter: btnVideoFile.horizontalCenter
|
|
readOnly: false
|
|
selectByMouse: true
|
|
}
|
|
|
|
FileDialog {
|
|
id: videoFileDialog
|
|
fileMode: FileDialog.OpenFile
|
|
nameFilters: ["Video files (*.mkv *.mp4)", "All files (*)"]
|
|
onAccepted: { const reg = /^file:\/\/\// //Remove "file:/// at start of URL
|
|
txtVideoFile.text = videoFileDialog.selectedFile.toString().replace(reg, "") }
|
|
}
|
|
}
|