Directory Listing with QML
QML and Qt Quick
4
Posts
3
Posters
7.0k
Views
1
Watching
-
I'm trying to list the content of a directory (of picture files) and store it in an array in order to display the pictures in a slideshow using QML.
I've tried to use ListView for that:
@import QtQuick 1.0
import Qt.labs.folderlistmodel 1.0Rectangle {
ListView {
width: 0; height: 0FolderListModel { id: folderModel folder: "file:///C:/QtProj/PigitalSignage/qml/PigitalSignage/video" nameFilters: ["*.*"] } Component { id: fileDelegate Text { text: fileName onTextChanged: { console.debug("Filename:-" + fileName + "-") } } } model: folderModel delegate: fileDelegate }}@
But this is not ideal since it will only show files that are displayed in the window, I could give a large number of height but that does seem too good.
I could also not find a way to create a (changeable) array with QML. I tried variant, but it seems read-only.
Is there a way to do that with QML, or do I need to work something out in C++?