No effect when working with Proxy models
dix75 opened this issue · comments
Hi
I added a proxy model to filter the data, but there is actually no filtering.
Do I need to force update the data by sending a signal to the view?
I didn't try proxy models. Try updating the data as you suggested. If you want to point out an example we can take a look at that.
- I've forked project to https://github.com/dix75/QMLTreeView
- I've created a new branch named 'proxy'
- I've added a new example 'proxy'
Try it.
Problems
- There is no automatic update, only through the reload function.
- Some number of errors in the qml, such as:
qrc:/modules/QMLTreeView/TreeViewItem.qml:132: TypeError: Type error
qrc:/modules/QMLTreeView/TreeViewItem.qml:132: TypeError: Property 'depth' of object TreeProxyModel(0x55fb98c8ce0) is not a function
The errors are because you're commented the depth function in your model and then you're trying to call it.
What do you mean with automatic update? In which case the view should be updated?
I tried your fork, but has several compile errors and crash (depth() is commented, Layouts version is 1.15, not 2.15, need to clear the console.log(), reload function it's not working).
Please push a working version so I could take a look better.
I am using version qt 6.5
The code works fine, but the program crashes if the 'a' character is entered.
There is no problem with other characters and text.
Do the models works properly with a QTreeView widget?
Yes, of course.
Yes, of course.
I tried to debug it, it's kinda weird. It's happens with 'a' and 'i' in the sample, I have not clue in this moment, I've marked this as bug