×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    95

    Question How to use QGalleryQueryModel with QML?

    Hi all,

    I am trying to use QGalleryQueryModel with QML file but i can't get any photo to appear. I am trying to display the images on the phone in my application.

    in main.cpp i wrote:
    Code:
    QGalleryQueryModel * model = new QGalleryQueryModel;
        model->setRootType(QDocumentGallery::Image);
        QHash<int, QString> properties;
        properties.insert(Qt::UserRole + 1, "url");
        model->addColumn(properties);
        viewer.rootContext()->setContextProperty("galleryModel", model);
    and in the QML file i wrote
    Code:
    import Qt 4.7
    import QtQuick 1.0
    import QtMobility.gallery 1.1
    
     Rectangle {
         width: 1024
         height: 768
    
         GridView {
             anchors.fill: parent
             cellWidth: 128
             cellHeight: 128
    
             model: galleryModel
    
             delegate: Image {
                 source: url
                 width: 128
                 height: 128
             }
         }
     }
    can any body help to display those images?

  2. #2
    Registered User
    Join Date
    Oct 2009
    Posts
    95

    Re: How to use QGalleryQueryModel with QML?

    can any body help?

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    95

    Re: How to use QGalleryQueryModel with QML?


Similar Threads

  1. How to call/load another QML file from QML ?
    By cadlg in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2011-07-28, 09:15
  2. How to use QFileDialog or another way for file browsing in QML UI ?
    By magpielover in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-05-12, 08:04
  3. How to use QML inside libraries
    By mnosov in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-01-14, 10:00
  4. Replies: 4
    Last Post: 2010-11-17, 08:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×