QAbstractItemView::dataChanged problem with ranges
-
I'm using TableView. I have a lot of data updates, so I'm buffering the updates and, with a given interval, I emit the dataChanged for the topLeft until the bottomRight indexes of buffered data, but the model's data method is called for every cell. Emit a signal for every updated cell will have a performance penalty too. A range update would be the best choice, I think.
Thank you,
Bruno -
Got myself the same problem. I update a QString list and want that QString list in a tableView (1 QString list per row), but how do I just update 1 row?
Greetz -
I found some tickets in QT's JIRA, one of them: QTBUG-13668. It seems this is the expected behavior, although I have some questions about it. I sow the source code of QAbstractItemView::dataChanged and there is a big difference handling topLeft == bottomRight and topLeft != bottomRight. In the first case only the cell with the given index is updated, in the second case, it passes the update responsibility to the viewport. For me this is a strange behavior, I would expect that the update was always handle by the viewport or always handled by QAbstractItemView and not distinguished if is only a cell or more.
I can see 2 solutions:
- Re-implement dataChanged method;
- Emit one signal for each cell.
Any other suggestion would be appreciated.
Tia,
Bruno