Bug #913
closedsetModel followed by other table commands result in undefined state
0%
Description
Take WTableView as a case, where one calls in order
WAbstractItemModel* model = getNewWAbstractItemModel(); // generate new model
WTableView* tv = getTableView(); // gets current defined table view
tv.setModel( model );
const WModelIndex index ( model->index( model.rowCount(), model.columnCount() ); // get last cell in model
tv.scrollTo(index );
tv.select( index );
The last two calls are operating over the tableview where the row/column values are taken from the prior model, as the setModel, will invalidate some of the values (i.e. first/last column are set to --1, while rows keep their value). So if the new model has more rows, than the prior model, then scrollTo/select will be ignored, as the new model hasn't been rendered yet into the table view.
Basically the problem is that until the new model is rendered into the table view, the table view has values from the prior model (or has invalidated some values in anticipation of the table view render).
In such a case, these calls, scrollTo/select, should be queue, and applied when the table view is rendered with the new model.
Files
Updated by Koen Deforche over 13 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
- Target version set to 3.1.11
Updated by Koen Deforche over 13 years ago
- File test192.cc test192.cc added
- Status changed from InProgress to Feedback
Hey,
I could not reproduce this. See attached test case. Can you modify this test case to reproduce the problem ?
Regards,
koen
Updated by Koen Deforche about 13 years ago
- Target version changed from 3.1.11 to 3.2.0
Updated by Koen Deforche about 13 years ago
- Status changed from Feedback to Resolved
Closed due to lack of feedback.
Updated by Koen Deforche almost 13 years ago
- Status changed from Resolved to Closed