Bug #1710
openaskRender crashing
0%
Description
I have a TreeView and TableView and the model is set to filterModel*(WSortFilterProxyModel) and filterModelTree*(WSortFilterProxyModel), respectively and those are set to WStandardItemModels.
I insert items to WStandardItemModel in a server thread and an inserted items shows up in the table view unless I select the node for which a row is being inserted. In such case, it crashes as given in the attached file at askRender. Will WReadOnlyProxyModel help here? If yes, what should be the model source settings?
Thanks
Files
Updated by Koen Deforche over 11 years ago
- Status changed from New to Feedback
Hey,
Yes, you cannot share a model currently between multiple sessions. WReadOnlyProxyModel would help only if you do not intend to change the model (i.e. if it is static), but this is not what you are trying to do ?
Regards,
koen
Updated by navnidhi sharma over 11 years ago
Koen,
Thanks for the response. I get the data from a socket and insert it continuously into the WStandardItemModel that is read only for the clients. The clients can only sort and select the data they want to see. I have defined WStandardItemModel in a singleton.
In the test, I did not use multiple clients yet. It crashes in a single client/browser test. I would like to try with the WReadOnlyProxyModel, but could you tell me the usage? Let's say, I have model(WStandardItemModel), filter(WSortFilterProxyModel), and readonly(WReadOnlyProxyModel) models. The model is being updated from the socket data and I call filter~~setSourceModel(model), filter>setDynamicSortFilter(true), filtersetFilterKeyColumn(kSortKey), and filter~~>setFilterRole(Wt::UserRole). Except first, the last functions are only defined for filter model. How will I use readonly model?
Thanks
Updated by Koen Deforche over 11 years ago
Hey,
You can't use readonly model for a model which gets updated --- it only supports the function of a 'static' model without data changes.
Regards,
koen