[GH-ISSUE #62] Support for ObservableCollection<> #34

Open
opened 2026-05-05 11:00:32 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @pauldotknopf on GitHub (Aug 19, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/62

You can set the Repeater.model property with an array, but it doesn't auto-update when the collection changes. You have to reset the property with the same value.

Repeater.model will internally check if the type being set is a QQmlInstanceModel, and if it is, it will auto-update itself when signals are raised on the model.

We should create derived type implementing QQmlInstanceModel that carries a .NET ObservableCollection<> instance. And events raised on the .NET collection will raise the signals on the QQmlInstanceModel. This will allow us to bind lists to Repeater and ListView QML components and have them automatically update/render when items are added/removed/updated.

Originally created by @pauldotknopf on GitHub (Aug 19, 2018). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/62 You can set the ```Repeater.model``` property with an array, but it doesn't auto-update when the collection changes. You have to reset the property with the same value. ```Repeater.model``` will internally check if the type being set is a ```QQmlInstanceModel```, and if it is, it will auto-update itself when signals are raised on the model. We should create derived type implementing ```QQmlInstanceModel``` that carries a .NET ```ObservableCollection<>``` instance. And events raised on the .NET collection will raise the signals on the ```QQmlInstanceModel```. This will allow us to bind lists to ```Repeater``` and ```ListView``` QML components and have them automatically update/render when items are added/removed/updated.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#34
No description provided.