This is my first post, so hi to everyone!
I'm italian, then i first ask to forgive me for my very bad english!
Now, my problem:
I'm using Qt model/view paradigm and yesterday I found an error I cannot understand. I have two tree view and a tree model. I use a QSortFilterProxy to re-define the sort criteria for my rows. This criteria are the same for each view. In addiction, I must filter some rows for one of the two views.
So, I've got this:
- create a standard tree view
- create a derived model to store my data -> the Model
- create a derived sort filter proxy to show my data sorted as i want -> the SortProxy
- create a derived sort filter proxy to filter some rows for one of my two views -> the FilterProxy
then, i set my model as source model for my SortProxy, and my SortProxy as source model for my FilterProxy.
Then, i start my program and populate my model. In the view associated with the FilterProxy, i'm catching a contest menu' request, to show a context menu' with some actions. When I click the right button of my mouse on a child node of this view, the application crash. The call stack shows that the problem was generating from a layoutChanged signal from the Model, I've something like this:
-->MyModel::layoutChanged
-->MyFilterProxy::reset
-->MyFilterProxy::clear
(...fails in "proxy_to_source"...)
After two hours of panic, I discovered that the problem derived form proxies in cascade: if a use two different sort filter proxy, one for each view, the problem disappear
Then, someone knows why I can't use proxies in cascade?
Thanks in advance :)