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. Append image in listModel

Append image in listModel

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.8k 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.
  • G Offline
    G Offline
    ggerard
    wrote on last edited by
    #1

    Inside a Rectangle, there is a definition of ListModel

    @ ListModel {
    id: tagsModel
    }@

    And afterwards, by javascript you can add text to this list

    @ tagsModel.append({"title": title, "id":id});@

    Where title and id are parsed text from a rss feed.

    My problem is that I don't know how to add an image here, the order

    @ tagsModel.append({
    "type":"image",
    "url":"http://doc.qt.nokia.com/whitepapers/qt-quick-tooling-whitepaper/wiki-images/Qt_logo.jpg",
    "source":"http://doc.qt.nokia.com/whitepapers/qt-quick-tooling-whitepaper/wiki-images/Qt_logo.jpg",
    });@

    doesn't work, nor other options (similar) that I've tried. So there is something wrong with it. After several days trying to find an example (I haven't), I think it's better to ask here what I'm doing wrong :)

    So any help will be greatly appreciated!

    Gerard

    • from NewsFlow source code, that I am trying to play with
    1 Reply Last reply
    0
    • F Offline
      F Offline
      fgungor
      wrote on last edited by
      #2

      Hi,

      You should supply your own image provider object. Here is the link to documentation

      http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeimageprovider.html

      Cheers!

      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