oKcerG / SortFilterProxyModel

A nicely exposed QSortFilterProxyModel for QML
MIT License
298 stars 101 forks source link

all values depending on model roles are re-read on every model change #60

Closed damianatorrpm closed 5 years ago

damianatorrpm commented 5 years ago

Model role1 role2 role3

Label { text: role1 } Label { text: role2 } //role 1 changes, role 2 is re-evaluated as well //with 0 filters/sorters

oKcerG commented 5 years ago

Hello,

Thanks for filing this issue. Can you share a minimal code example reproducing this problem?

Cheers

damianatorrpm commented 5 years ago

Hello, thank you for acknowledging the issue and the plugin itself. I will be able to do so earliest tomorrow afternoon.

damianatorrpm commented 5 years ago

https://ufile.io/w067h this is the example based on official Qt example for qbstractitemmodel (animalmodel).

run and observe command line output when clicking the change button please indicate that you confirm the issue

    SortFilterProxyModel
    {
        id: myProxyModel
        sourceModel: myModel
    }
    ListView
    {
        width: 200; height: 250

        model: myProxyModel //clicking button changeSize requests size and type multiple times
    //    model: myModel //clicking button changeSize requests size 1 time
damianatorrpm commented 5 years ago

I decided to move away from SortFilterProxyModel qml plugin due to it being not (not really) maintained. It is still very good for prototyping you QSortFilterProxyModel

Though valid, Feel free to close the bug

damianatorrpm commented 5 years ago

for future references if someone is interested at some point: https://build.opensuse.org/source/home:damianator/test/bug_sortfilterproxymodel60.zip?rev=710ebb63c6cba5a10864eef05fd27e36