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. How to reload the repeater's data model in QML?
Forum Updated to NodeBB v4.3 + New Features

How to reload the repeater's data model in QML?

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

    I've a QML with Repeater which uses QList(QObjects) as its data model. On a button click, an attribute QLIST X object is updated. As the underlying data model property value is updated, I wish to have the updated property value reflected in my QML.

    I tried emiting a SIGNAL from cpp when the property value is changed, However, I don't get to see the changes reflected in QML UI i.e. the repeater is not sensing the UPDATED QList.

    @
    Repeater {
    id: repeaterSlot
    model: dataSupplier
    Image
    {
    id: imgSlot
    width: 75; height: 75
    source: "images/"+modelData.imageName + ".png";
    }
    }
    @

    In the above scenario, the imageName of underlying QObject is updated on click of a button. I want to Repeater to fetch the recently updated QList(QOBjects), refresh the image to show latest picture.

    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