Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How can I display multiple images from local directory in a QML Project?
Forum Updated to NodeBB v4.3 + New Features

How can I display multiple images from local directory in a QML Project?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Double A
    wrote on last edited by
    #1

    Hi Developers! I'm trying to display multiple images from local directory in a QML Project, How can I possibly do that in my QML Project? . I'm a newbie in QT programming. Please do help me. I highly appreciate any kind of answer, suggestion and idea regarding this matter. Hoping that you can help me guys. Thank you! Sorry for my English grammar.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      The Image type would be a good starting point.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        The Image type would be a good starting point.

        D Offline
        D Offline
        Double A
        wrote on last edited by Double A
        #3

        @SGaist I'm going to display multiple JPG file from a local directory, can I possibly do that using QML? . Thank you!

        J.HilkJ 1 Reply Last reply
        0
        • D Double A

          @SGaist I'm going to display multiple JPG file from a local directory, can I possibly do that using QML? . Thank you!

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          hi @Double-A
          yeas you can,

          I would suggest looking at the PhotoViewer Example

          it should be able to find it in the example section of QtCreator as well


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          D 1 Reply Last reply
          0
          • D Offline
            D Offline
            Double A
            wrote on last edited by Double A
            #5

            Hello! I'm using this code, this is code is running, but no image display. I'm using Ubuntu.

            ListView {

                width: 400;
                height: 500
            
                FolderListModel {
                    id: folderModel
                    nameFilters: ["*.jpg"]
            
                    folder: "/home/pc/jpeg_serial_capture/Capture_Image/04-02-2019"
                }
            
                Component {
                    id: fileDelegate
                    Column {
                        Image {
                            width: 150; height: 150
                            fillMode: Image.PreserveAspectFit
                            smooth: true
                            source: folderModel.folder + "/home/pc/jpeg_serial_capture/Capture_Image/04-02-2019" + fileName
                        }
                        Text { text: fileName }
                    }
                }
            
                model: folderModel
                delegate: fileDelegate
                }
            
            1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              hi @Double-A
              yeas you can,

              I would suggest looking at the PhotoViewer Example

              it should be able to find it in the example section of QtCreator as well

              D Offline
              D Offline
              Double A
              wrote on last edited by Double A
              #6

              @J.Hilk Thank you, I will do that.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved