×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    64

    Question QGalleryQueryModel returns empty

    Hi,

    I am trying to build model, including image filenames with following code. But result is empty. Whats wrong?

    model = new QGalleryQueryModel(this);
    model->setRootType(QDocumentGallery::Image);

    model->addColumn(QDocumentGallery::fileName);
    model->setHeaderData(0, Qt::Horizontal, tr("File Name"));

    QTableView *view = ui->tableView;
    view->setShowGrid(false);
    view->verticalHeader()->setVisible(false);
    view->setSelectionBehavior(QAbstractItemView::SelectRows);
    view->setModel(model);

  2. #2
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    64

    Re: QGalleryQueryModel returns empty

    Hi,

    no body has any idea or sample to create a data model with qmobilty?

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: QGalleryQueryModel returns empty

    Hi,

    In which device are you trying the below code.

    Please note that you will have to add the required capability for some older versions

    Details can be found in https://bugreports.qt-project.org/br...TMOBILITY-1962

  4. #4
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    64

    Re: QGalleryQueryModel returns empty

    Hi,

    So far I try with simulator. Media browser sample works fine. But I do not want to use their class spliting method. But when I use above sample it does not works. With sample code and create model in the different class, it works. But why it is not working on the mainwindow.class

    Thanks for link but I do not use QML.

  5. #5
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: QGalleryQueryModel returns empty

    model = new QGalleryQueryModel(this) ;

    the parameter makes difference here, when you use 'this' in mainwindow class it would refer to mainwindow object

    and if you create a new class for model then you would be sending a different depending on from where you are deriving. And as model class comes as part of backend and not ui, it is better to keep it separate from mainwindow.

    Hence, keeping it in a diff class works.

Similar Threads

  1. How to use QGalleryQueryModel with QML?
    By mismael in forum [Archived] Qt Mobility Project
    Replies: 2
    Last Post: 2011-05-14, 22:37
  2. CBaseMtm::AddresseeList() returns empty recipients list
    By jkopera in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-11-21, 15:15
  3. Replies: 0
    Last Post: 2005-09-02, 14:03
  4. AT+CSCA? returns empty string with 6210?
    By kesslerdesign in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00
  5. AT+CSCA? returns empty string with 6210?
    By kesslerdesign in forum General Messaging
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

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