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. Load Image From Device

Load Image From Device

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 2 Posters 788 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.
  • T Offline
    T Offline
    tacdin
    wrote on last edited by
    #1

    Hi, I want to load photos dynamically from my device (local) to the user interface using JS functions or QML's own features. I opened a post about it before, but I guess no one responded because it was too long or because I explained it complicated. I would be glad if you could help me with this.

    POST

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      If you know the directory of photos, you can use Qt.resolved(..) api, convert the directory to url format. Now you should be able to display them.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      T 2 Replies Last reply
      0
      • dheerendraD dheerendra

        If you know the directory of photos, you can use Qt.resolved(..) api, convert the directory to url format. Now you should be able to display them.

        T Offline
        T Offline
        tacdin
        wrote on last edited by
        #3

        @dheerendra Yes I know the directory. I've never used it before, I'll try it now. Thanks for the suggestion. I hope I can make it.

        1 Reply Last reply
        0
        • dheerendraD dheerendra

          If you know the directory of photos, you can use Qt.resolved(..) api, convert the directory to url format. Now you should be able to display them.

          T Offline
          T Offline
          tacdin
          wrote on last edited by
          #4

          @dheerendra I think I need to add "source: " property in Image.

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            Yes. source property should be set with images you are trying to display.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            T 2 Replies Last reply
            0
            • dheerendraD dheerendra

              Yes. source property should be set with images you are trying to display.

              T Offline
              T Offline
              tacdin
              wrote on last edited by
              #6

              @dheerendra The user may want to upload a different photo from the directory each time. Will it work in this case?

              1 Reply Last reply
              0
              • dheerendraD dheerendra

                Yes. source property should be set with images you are trying to display.

                T Offline
                T Offline
                tacdin
                wrote on last edited by tacdin
                #7

                @dheerendra
                Unfortunately, the method you suggested does not work :( I don't want a single photo to be uploaded from local. User should be able to enter the local folder and select the photo wants from it.

                1 Reply Last reply
                0
                • dheerendraD Offline
                  dheerendraD Offline
                  dheerendra
                  Qt Champions 2022
                  wrote on last edited by
                  #8

                  From the directory you should read the filenames, build the model & then show them in your app.

                  Dheerendra
                  @Community Service
                  Certified Qt Specialist
                  http://www.pthinks.com

                  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