hickscorp
7th June 2011, 15:25
Hello,
i have a setup which involves two QTableViews. Both are linked to custom models (SQL derived), and basically acts as a hierarchy view (First QTableView displays objects of first database table, upon click on them the belonging objects from another database table are displayed on the second QTableView).
On the first QTableView, there is a "virtual column" displaying a summary of what's belonging to the first type. Actually, this virtual column display the count of children matching a condition. This very column is handled by a very simple text-ish item delegate.
However, here is my problem. If i select an item from my first table, then the cascading children are displayed on my second table. At this point, if i change data on the second table, i would like to be able to update the "count" column on the first time in real-time... But i have no idea how to do that.
i an actually catching any modification made on objects from the 2nd table model, but i'm not sure what to do in that method (dataChanged slot). Do i have to force the painting of the item-delegate generated widget of the first table? Can i notify the first table that the data of the "count" virtual column has changed in a special way?
Thanks a lot!
Pierre.
i have a setup which involves two QTableViews. Both are linked to custom models (SQL derived), and basically acts as a hierarchy view (First QTableView displays objects of first database table, upon click on them the belonging objects from another database table are displayed on the second QTableView).
On the first QTableView, there is a "virtual column" displaying a summary of what's belonging to the first type. Actually, this virtual column display the count of children matching a condition. This very column is handled by a very simple text-ish item delegate.
However, here is my problem. If i select an item from my first table, then the cascading children are displayed on my second table. At this point, if i change data on the second table, i would like to be able to update the "count" column on the first time in real-time... But i have no idea how to do that.
i an actually catching any modification made on objects from the 2nd table model, but i'm not sure what to do in that method (dataChanged slot). Do i have to force the painting of the item-delegate generated widget of the first table? Can i notify the first table that the data of the "count" virtual column has changed in a special way?
Thanks a lot!
Pierre.