diff options
author | q5sys <jt@xsystems.com> | 2017-10-25 11:24:08 -0400 |
---|---|---|
committer | q5sys <jt@xsystems.com> | 2017-10-25 11:24:08 -0400 |
commit | a49323e9916171c7353a318acf0243a6100efb61 (patch) | |
tree | 709f07c908b2828a82bb54d2e8e993a874393a56 /src-qt5/src-qml | |
parent | fixed handling of initial arguments (diff) | |
parent | Added some test qml file for the video screensaver (diff) | |
download | lumina-a49323e9916171c7353a318acf0243a6100efb61.tar.gz lumina-a49323e9916171c7353a318acf0243a6100efb61.tar.bz2 lumina-a49323e9916171c7353a318acf0243a6100efb61.zip |
Merge branch 'master' of http://github.com/trueos/lumina
Diffstat (limited to 'src-qt5/src-qml')
-rw-r--r-- | src-qt5/src-qml/test/File.qml | 21 | ||||
-rw-r--r-- | src-qt5/src-qml/test/Video.qml | 50 |
2 files changed, 71 insertions, 0 deletions
diff --git a/src-qt5/src-qml/test/File.qml b/src-qt5/src-qml/test/File.qml new file mode 100644 index 00000000..4713a454 --- /dev/null +++ b/src-qt5/src-qml/test/File.qml @@ -0,0 +1,21 @@ +import QtQuick 2.0 +import Qt.labs.folderlistmodel 2.1 + +ListView { + width: 200; height: 400 + + + FolderListModel { + id: folderModel + folder: "/usr/local/videos" + } + + Component { + id: fileDelegate + Text { text: fileName } + } + + model: folderModel + delegate: fileDelegate + Component.onCompleted: { console.log(folderModel.count) } +} diff --git a/src-qt5/src-qml/test/Video.qml b/src-qt5/src-qml/test/Video.qml new file mode 100644 index 00000000..e7d0626d --- /dev/null +++ b/src-qt5/src-qml/test/Video.qml @@ -0,0 +1,50 @@ +import QtQuick 2.0 +import QtMultimedia 5.7 +import QtQuick.Window 2.2 +import Qt.labs.folderlistmodel 2.1 + +Rectangle { + //width: Screen.width + //height: Screen.height + width: 800 + height: 600 + color: "black" + + FolderListModel { + id: folderModel + folder: "/usr/local/videos" + } + + Repeater { + model: folderModel + Component { + Item { + Component.onCompleted: { playlist.addItem(fileURL) } + } + } + } + + Playlist { + id: playlist + playbackMode: Playlist.Random + PlaylistItem { source: "/" } + onError: { console.log("ERROR") } + } + + MediaPlayer { + id: player + autoPlay: true + playlist: playlist + } + + VideoOutput { + id: videoOutput + source: player + anchors.fill: parent + } + + Component.onCompleted: { + playlist.shuffle() + console.log(playlist.itemCount) + } +} |