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
Forum Updated to NodeBB v4.3 + New Features

How do I choose from photos stored on my phone

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 5 Posters 703 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 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
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on 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 last edited by
        #3

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

        jsulmJ 1 Reply Last reply
        0
        • M Mikeeeeee

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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #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 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?

            JonBJ 1 Reply Last reply
            0
            • M Mikeeeeee

              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?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #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
              • IntruderExcluderI Offline
                IntruderExcluderI Offline
                IntruderExcluder
                wrote on 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.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on 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

                  • Login

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