Qt World Summit: Register Today!

How to display the images in GridView in descending order ?

  • Hi I'm trying to display images in descending order in GridView ?

    The images that I need to display come from a local directory of captured images of my serial camera, What I want to do is to display in the GridView, the latest image that will be added in the local folder. Thank you in Advance for your help

    This is my current code:

    Rectangle {
        visible: true
        FolderListModel {
            id: folderModel
            nameFilters: ["*.jpg"]
            folder: "file:///E:/Camera-pics/camera"
        Component {
            id: fileDelegate
            Image {
                width: gridView.cellWidth - 5
                height: gridView.cellHeight - 5
                smooth: true
                source: fileURL
        GridView {
            id: gridView
            anchors {
                fill: parent
                leftMargin: 5
                topMargin: 5
            cellWidth: width / 2
            cellHeight: height / 2
            model: folderModel
            delegate: fileDelegate

    Thank you in advance for your Help

  • I finally found the answer in my problem:

    FolderListModel {
    sortReversed: true