Important: Please read the Qt Code of Conduct -

How to refresh FolderListModel?

  • hello everybody,

    Is there any way to refresh the FolderListModel so the view is able to display the new files added.

    Thank you

  • You mean when files are added in the folder, then the FolderListModel should automatically update the model?

    Or manually refresh the FolderListModel?

  • there is no deference I need the view to feel that something is added, whether this done manually or automatically.

  • I know this is an old thread but I searched for a long time to find an answer to this. The following worked for me, without this, when a file was added/deleted the list view was not updated properly (unless I exited and reopened the application).

    @import QtQuick 1.1
    import Qt.labs.folderlistmodel 1.0

    ListView {
    id: view
    model: folderModel
    delegate: Text { text: fileName }

    property variant folderModel
    function updateModel() {
        var folder = ""
        if (folderModel) {
            folder = folderModel.folder
        folderModel = modelComponent.createObject(view, {"folder": folder})
    Component {
        id: modelComponent
        FolderListModel {}
    Component.onCompleted: updateModel()

    Source from:

  • Looks like FolderListModel update the list automatically once new files are added or remove from path:(Qt5.7.1)

                anchors.fill: parent
                    id: folderModelUSB
                    folder: "file:///mnt/usb"
                model: folderModelUSB
                    text:  fileName
                    anchors.horizontalCenter: parent.horizontalCenter

Log in to reply