Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Accessing Image gallery of a mobile phone and view images...
Qt 6.11 is out! See what's new in the release blog

Accessing Image gallery of a mobile phone and view images...

Scheduled Pinned Locked Moved Mobile and Embedded
13 Posts 5 Posters 5.9k 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.
  • A Offline
    A Offline
    andre
    wrote on last edited by
    #4

    AFAIK, there is no Qt API for this yet.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #5

      hello andre..
      so how we can do it then..

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #6

        Look at the symbian API's?

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #7

          hi gerolf, i have tried something...
          you please check it out

          @
          void Dialog::searchImagesFromDir(QString path)
          {
          // imageIndex = 0;

          QDir dir;
          dir.setFilter(QDir::Files | QDir::Dirs);
          dir.setPath(path);
          QString paths = "the available images are";
          QFileInfoList list = dir.entryInfoList();
          for (int i = 0; i < list.size(); ++i)
          {
              QFileInfo fileInfo = list.at(i);
              if (fileInfo.isFile&#40;&#41;&#41;
              {
                  QString s = fileInfo.filePath(&#41;;
                  paths += s + "a";
                  if (s.indexOf(QString(".png"&#41;, 0, Qt::CaseInsensitive) > 0)
                  {
                      imageList.append(s);
                  }
              }
              else
              {
          
                  QString s = fileInfo.filePath();
                   paths += s + "b";
                  if (!s.contains(".") && !s.contains(".."))
                      searchImagesFromDir(fileInfo.filePath());
              }
          }
          ui->lblImages->setText(paths);
          

          }
          @

          EDIT: Please only use one @ tag at beginning and one at end of code, gerolf

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #8

            What do you want to show with this code?
            What is imageList?
            why do you append a and be to paths?
            ...

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #9

              hi gerolf...
              firstly our aim is to retrieve all the images in the for say C:/images for that we have used imagelist..

              secondly a and b we have appended to just test..whether our code reaches there..

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #10

                And...? Did you succeed? If not, what problems did you encounter?

                Perhaps a simpeler solution would be to use QFileSystemModel, and set a filter on image types. If you know where your images are on the file system, that should be an easy solution.

                Also, note that there are many demo's displaying images from a path on the system or even from an online service available online. You way want to let those inspire you.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #11

                  hi andre...i have not succeeded yet....i m trying my level best

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #12

                    hi andre..can u send me the link

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #13

                      Hi,
                      What about the QtMobility.gallery 1.1

                      I have tried this example code below from Mobility reference documentation but no error and no expected output either. Have anybody any idea that how does this gallery library can be used successfully in N900 or MeeGo for example.

                      Note: I was trying also to access any image metaData (e.g date, time etc.) but did not find any QML/Qt based API that helps to get it. Anybody any idea?

                      Code:

                      import Qt 4.7
                      import QtMobility.gallery 1.1

                      Rectangle {
                      height: 854; width: 480
                      color: "white"

                       GridView {
                                anchors.fill: parent
                                cellWidth: 128
                                cellHeight: 128
                      
                                model: DocumentGalleryModel {
                                    rootType: DocumentGallery.Image
                                    properties: [ "url" ]
                                    filter: GalleryWildcardFilter {
                                        property: "fileName";
                                        value: "*.jpg";
                                    }
                                }
                      
                                delegate: Image {
                                    source: url
                                    width: 128
                                    height: 128
                                }
                            }
                      

                      }

                      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