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

  • Hello friends,
    I want to access the default image gallery of mobile phone and view the images and i also want to set the zoom levels...
    so friends if you have any idea,,please share it with me..


  • Moderators

    Some hint about which phones you want to target would be helpful...

  • hi tobias,symbian phones i will be tryng..

  • AFAIK, there is no Qt API for this yet.

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

  • Look at the symbian API's?

  • 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);
    QString paths = "the available images are";
    QFileInfoList list = dir.entryInfoList();
    for (int i = 0; i < list.size(); ++i)
        QFileInfo fileInfo =;
        if (fileInfo.isFile&#40;&#41;&#41;
            QString s = fileInfo.filePath(&#41;;
            paths += s + "a";
            if (s.indexOf(QString(".png"&#41;, 0, Qt::CaseInsensitive) > 0)
            QString s = fileInfo.filePath();
             paths += s + "b";
            if (!s.contains(".") && !s.contains(".."))


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

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

  • 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..

  • 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.

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

  • hi andre..can u send me the link

  • Hi,
    What about the 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?


    import Qt 4.7
    import 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


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.