I mean that I need to update all data in the table when the call setData().

But if you look at WAbstractItemView::closeEditor(), you'll see that
first called saveEditedValue(..) (it will call setData()), where I
call modelReset().

modelReset() do editedItems_.clear() !

But next closeEditor() do editedItems_.erase(i), but editedItems_
already clean, and this will segmentation fault.

My patch solved the problem. But I think you should look at this as a
developer of the complex, and include the ability to call modelReset()
of setData()

Regards,
Aleksey

2010/10/26 Koen Deforche <[email protected]>:
> Hey Aleksey,
>
> 2010/10/25 Aleksey Chirkin <[email protected]>:
>> Hey Koen,
>>
>> I have implemented a model based on WAbstractItemModel that represents
>> the database table in WTableView.
>> I saw the problem that when my table will be change more than one
>> user, because the mechanism dataChanged(...) not like.
>> At that time, as one user to change something, the table may change by
>> other user, and after data will be saved, I need to update all the
>> data completely. I therefore emit modelReset signal in setData of my
>> model, but it is crash my app. You will understand why this is
>> happening, looking at my patch.
>>
>> Please consider possible solutions to this problem. I hope you understand it.
>
> I'm not understanding entirely (you seem to imply that you are sharing
> a model between two sessions, that can't be right ?)
>
> But, so, you end up doing modelReset() during setData() and I can
> understand that this comes unexpected to WTableView. Does your patch
> solve this problem for you ?
>
> Regards,
> koen
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to