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 do I choose from photos stored on my phone
QtWS25 Last Chance

How do I choose from photos stored on my phone

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 5 Posters 613 Views
  • 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on 11 Sept 2019, 08:36 last edited by
    #1

    Hi!
    How do I choose from photos stored on my phone?
    For example, so do in messengers.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      IntruderExcluder
      wrote on 11 Sept 2019, 08:53 last edited by
      #2

      Use FileDialog from platform module. Probably you need correct rights to acces photos from your app.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mikeeeeee
        wrote on 11 Sept 2019, 17:16 last edited by
        #3

        But FileDialog shows all files and folders. How can I preview all photos in one window?

        J 1 Reply Last reply 12 Sept 2019, 05:23
        0
        • M Mikeeeeee
          11 Sept 2019, 17:16

          But FileDialog shows all files and folders. How can I preview all photos in one window?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 12 Sept 2019, 05:23 last edited by jsulm 9 Dec 2019, 05:24
          #4

          @mikeeeeee You did not read the documentation, right?
          For QML: https://doc.qt.io/qt-5/qml-qtquick-dialogs-filedialog.html#nameFilters-prop
          For Widgets: https://doc.qt.io/qt-5/qfiledialog.html#setNameFilter (one of the possibilities)

          "How can I preview all photos in one window?" - I don't think you can as on Android photos can be stored in different locations.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M Offline
            M Offline
            Mikeeeeee
            wrote on 12 Sept 2019, 18:33 last edited by
            #5

            But for example, Skype and other messengers display pictures from all over the phone. So it can be done. I wonder how it can be done?

            J 1 Reply Last reply 12 Sept 2019, 20:01
            0
            • M Mikeeeeee
              12 Sept 2019, 18:33

              But for example, Skype and other messengers display pictures from all over the phone. So it can be done. I wonder how it can be done?

              J Offline
              J Offline
              JonB
              wrote on 12 Sept 2019, 20:01 last edited by JonB 9 Dec 2019, 20:02
              #6

              @mikeeeeee
              So if you/we do not know of a "phone system call" to do this, and QML/Qt does not offer anything for it, you have to look over the phone/in known locations to find the photos, and roll your own "file chooser" for it instead of FileDialog. Perhaps that is all Skype etc. are doing in code.

              1 Reply Last reply
              0
              • I Offline
                I Offline
                IntruderExcluder
                wrote on 12 Sept 2019, 20:26 last edited by
                #7

                To do this you will probably need to go deeper use phone OS native API.

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  J.Hilk
                  Moderators
                  wrote on 13 Sept 2019, 05:39 last edited by J.Hilk
                  #8

                  this, blog post is probably exactly what you're looking for, even has an example project, if I see that correctly

                  accroding to the poster, the example doesn't work out of the box for newer versions of android, you'll have to apply some fixes apparently.


                  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.

                  1 Reply Last reply
                  2

                  8/8

                  13 Sept 2019, 05:39

                  • Login

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